Here is a simple example from one of my scripts. You can use the method of mirror, getstore, use LWP::Simple; if(is_success(getstore("http://$sitename/wsp/scripts/$cgiscript/data.txt","/$pkg::cgiroot/$pkg::cgidir/admin/scripts/$cgiscript/data.txt"))){ print STDERR "\n Transfered http://$hostprog/wsp/scripts/$cgiscript/data.txt"; }else{print STDERR "\n Couldn't transfer file $!"; print STDERR "\n Couldn't transfered http://$hostprog/wsp/scripts/$cgiscript/data.txt";} }
#this is from this page at cpan: http://search.cpan.org/author/GAAS/libwww-perl-5.69/lib/LWP/Simple.pm perl -MLWP::Simple -e 'getprint "http://www.sn.no"' use LWP::Simple; $content = get("http://www.sn.no/"); die "Couldn't get it!" unless defined $content; if (mirror("http://www.sn.no/", "foo") == RC_NOT_MODIFIED) { ... } if (is_success(getprint("http://www.sn.no/"))) { ... } --- wendy soros <[EMAIL PROTECTED]> wrote: > Hi, > > I am a new perl user. I have a question of obtaining > web page contents with perl. Hope you can help me. > > Here is my question: how can I use perl to access a > webpage, fill in some search parameters, pull out > parts of the search results returned that I really > need and save them in a file? > > For example, a web site has some information about a > bunch of companies for various years. After one puts > in the company name and the relevant years, one > would > be directed to another page that has the text > contents > needed. > > I have the file containing the company names and the > years I want. Since the number of companies I have > is > large, it would be really nice to have perl pull out > the contents for me. Could it do this? How? What if > I > need to access the web page through a proxy server? > > Once again, I am new to the perl community and I am > sorry if the question is too simple. But I do need > you > help. Thanks a lot. > > Wendy > > > > > __________________________________ > Do you Yahoo!? > Yahoo! SiteBuilder - Free, easy-to-use web site > design software > http://sitebuilder.yahoo.com > > -- > To unsubscribe, e-mail: > [EMAIL PROTECTED] > For additional commands, e-mail: > [EMAIL PROTECTED] > __________________________________ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]