Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I am new to perl scripting.I wrote a small script to access a web link and get the output in a file named output.txt.
my output.txt has several lines in it but I need only few lines from the whole file.I know how to search for one line and print it in my final output file.
here is my question.
I want to print all those few lines i want from my output file into my final output file.here is the code I am using to search and print one line from my output file
my $output = $mech->content(); open(OUTFILE, ">$outfile"); print OUTFILE "$output"; if ( $output=~ /(line i want )/ ) { open( FINAL, ">", "final output.txt" ); print FINAL "$1"; } close FINAL;
Please Advise.....
Thanks in Advance..
|
|---|