#!/usr/bin/perl -w use strict; use LWP::Simple; my $data = get ("http://www.bloomberg.com/energy/index.html"); my ($wanted) = $data =~ /\s*(.*?)\s*/s; # the .*? speeds up processing considerably $wanted=~ s/^[^\n]*\n//s; # just remove the first line open (FH,'>test_remline.txt') || die $!; # > creates a new file, >> appends print FH $wanted; close FH; # not really necessary in this simple scrip