[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] Will webget work in MacPerl.



On Sun, 8 Mar 1998 17:55:51 -0500, Chris Nandor wrote:
>
>Don't use webget.  It is old code, and can be done much more easily with
>modules that come with MacPerl.
>
>What do you need to do, fetch a web page?
>
>  #!perl -w
>  use LWP::Simple;
>  $x = get('http://www.ptf.com/macperl/');
>  print $x;

Actually, in this case it should be either

getprint ('http://www.ptf.com/macperl/');

or

($x = get('http://www.ptf.com/macperl/')) =~ s/\012/\n/g;
print $X;

LWP is designed internally to spit out Unix text, and it's simply not
worthwhile to change that. getprint is the only routine that's been fixed
to spit out Mac text.

> 
>FYI, the problem with webget (particularly, network.pl) is that it calls
>out to the Unix shell to run nslookup, ifconfig, and other things that
Macs
>don't have (on a shell, anyway).  But the above code works out of the box
>on current versions of MacPerl.
>
>Hope this helps,
>
>--
>Chris Nandor          mailto:pudge@pobox.com         http://pudge.net/
>%PGPKey=('B76E72AD',[1024,'0824 090B CE73 CA10  1FF7 7F13 8180 B6B6'])
>#== New Book: MacPerl: Power and Ease ==#
>#== Publishing Date: Early 1998. http://www.ptf.com/macperl/ ==#
>



-------
Paul J. Schinder
schinder@pobox.com


***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch