use LWP::Simple; my $data = get('http://www.jaywil.com/libsearch/SAMPLE.TXT'); open DATAFILE, '<', \$data; while () { print $_; }