nascent has asked for the wisdom of the Perl Monks concerning the following question:

I have two problems. I'm not going to list the problem explicitly, because I don't want someone to solve it for me, I just want to know the syntax and hammer it out on my own.

(1) How do I put the entire contents of a URL into a scalar? I'm guessing something like $result = 'lynx http://www.nonsense.com/'; but I'm not sure.

(2) How do I have my script mail me something?

Thanks! nascent

Replies are listed 'Best First'.
Re: URL2Scalar & Emailing myself
by chromatic (Archbishop) on Mar 27, 2000 at 07:47 UTC
      When I try the first option from How can I load a webpage into my program?, I get:

      nascent@snafui perl$ cat ./url.pl #!/usr/bin/perl use LWP::Simple; $webpage=get "http://www.perlmonks.org"; print $webpage; nascent@snafui perl$ ./url.pl Can't locate LWP/Simple.pm in @INC (@INC contains: /usr/lib/perl5/5.00503/i386-linux /usr/lib/perl5/5.00503 /usr/lib/perl5/site_perl/5.005/i386-linux /usr/lib/perl5/site_perl/5.005 .) at ./url.pl line 3. BEGIN failed--compilation aborted at ./url.pl line 3. When I try the second option, I get:

      nascent@snafui perl$ cat ./url.pl #!/usr/bin/perl $webpage='lynx -source http://qs.cnnfn.com/tq/stockquote?symbols=AKAM'; print $webpage; nascent@snafui perl$ ./url.pl lynx -source http://qs.cnnfn.com/tq/stockquote?symbols=AKAMnascent@snafui perl$

        It looks like you don't have LWP::Simple installed, which is weird, since I thought it was a standard module... perhaps not. Anyway, go to CPAN and install Bundle::LWP.
      Ignore that last post. Geez, I wish this site had a preview button for this area...

      nascent

RE: URL2Scalar & Emailing myself
by vroom (His Eminence) on Mar 27, 2000 at 10:03 UTC
Re: URL2Scalar & Emailing myself
by btrott (Parson) on Mar 27, 2000 at 09:28 UTC
    For mailing data to yourself, take a look at sendmail or Mail::Mailer (or Mail::Internet, which uses SMTP rather than sendmail). Take a look at How do I send mail? to find out which options to use for sendmail.