Re: [MacPerl-WebCGI] Re: Problems with Macperl 5.6+CGI.PM

[email protected] (Ryan Surber) Sun, 14 Apr 2002 12:08:17 -0700 (PDT)
Newsgroups perl.macperl.webcgi
Message-ID <[email protected]>
--- Chris Nandor <[email protected]> wrote:
> In article
>
<[email protected]>,
>  [email protected] (Ryan Surber) wrote:
> 
> > I setup Macperl and ran this script (straight off
> the
> > website).
> > 
> > #!/usr/bin/perl
> > use LWP::Simple;
> > 
> > my $content = get("http://www.yahoo.com"); #Store
> the
> > output of the web page (html and all) in content
> > if (defined $content)
> > {
> >     #$content will contain the html associated
> with
> > the url mentioned above.
> >     print $content;
> > }
> > else
> > {
> >     #If an error occurs then $content will not be
> > defined.
> >     print "Error: Get failed";
> > }
> 
> I'm confused ... what does this have to do with
> CGI.pm?


D'oh!!! I meant LWP.pm not CGI.pm


> 
> 
> > .... problem is, I can't get more than a few lines
> > worth of text from the page.
> 
> It works just fine for me.  Maybe it is your ISP's
> proxy or somesuch.
> 
> Note that before printing the content, you should
> do:
> 
>    $content =~ s/\015?\012/\n/g;
> 
> To convert LF and CRLF to the Mac OS newline.
> 
> -- 
> Chris Nandor                      [email protected]   
> http://pudge.net/
> Open Source Development Network    [email protected]   
>  http://osdn.com/


__________________________________________________
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
http://taxes.yahoo.com/