in reply to Help removing first line from retrieved text file.

Please use Super Search and Search before asking questions.
You must of missed my CB reference to Deleting the first line of a file.
As an exercise, use your title in the search box (upper left).

  • Comment on Re: Help removing first line from retrieved text file.

Replies are listed 'Best First'.
Re: Re: Help removing first line from retrieved text file.
by Whitey (Novice) on Jun 25, 2001 at 10:07 UTC
    I saw the code and have updated it as follows. The darned first line is still there.
    #!/usr/bin/perl -w use strict; use LWP::Simple; my $data = get ("http://www.bloomberg.com/energy/index.html"); my ($wanted) = $data =~ /<!-+PETROLEUM-+>\s*(.*)\s*<!-+POWER-+>/s; open (FH,'>../data/file.txt') || die $!; print FH $wanted; close FH; open(FH, '+< ../data/file.txt') || die "Could not open $myfile $!\n"; @bar=<FH>; shift(@bar); seek(FH, 0, 0); truncate(FH, tell); print FH @bar; close(FH);