in reply to Perl on Windows XP needs to grab internet txt file.

Consider using LWP::Simple::mirror for your specific task. There's a good example of its use in the article about LWP::Simple on the 22nd day of the 2003 Perl Advent Calendar.

Here's my own example:

#!C:/Perl/bin/perl.exe use strict; use warnings; use LWP::Simple qw( mirror is_error RC_NOT_MODIFIED ); my $url = 'http://rabbit.eng.miami.edu/dics/pocket.txt'; my $file = $url; $file =~ s{.*/}{}; my $status = mirror($url, $file); if (is_error($status)) { die "Can't get text file at URL $url\n"; } if ($status == RC_NOT_MODIFIED) { warn "File $file not modified\n"; } # Do something with freshened file named pocket.txt... exit 0;
See 14.13 Content-Length and 14.25 If-Modified-Since for the gory details of what's going on under the hood.

Cheers!

Jim

Replies are listed 'Best First'.
Re^2: Perl on Windows XP needs to grab internet txt file.
by kansaschuck (Sexton) on Feb 03, 2008 at 15:35 UTC
    Thanks all! I went with the LWP Perl modules to access remote files. And that worked very well. ' thanks, kc