Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: simple question on next line parameter

by Polyglot (Pilgrim)
on May 19, 2009 at 03:44 UTC ( #764810=note: print w/ replies, xml ) Need Help??


in reply to simple question on next line parameter

Why not just do it this way?

open OUTFILE, "<$outfile"; my @OUT = <OUTFILE>; open FINAL, ">$final"; my $line; foreach $line(@OUT) { if ($line=~/(my first line)<br>/) {print FINAL "$1\n"} if ($line=~/(my second line)<br>/) {print FINAL "$1\n\n"} if ($line=~/(my third line)<br>/) {print FINAL "$1\n"} }

Blessings,

~Polyglot~


Comment on Re: simple question on next line parameter
Download Code
Re^2: simple question on next line parameter
by Bloodnok (Vicar) on May 19, 2009 at 17:44 UTC
    ...or even
    open OUTFILE, "<$outfile"; open FINAL, ">$final"; foreach my $line (<OUTFILE>) { print FINAL "$1\n" if $line =~ /(my first line|my second line|my third line)<br>/); }
    A user level that continues to overstate my experience :-))

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://764810]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (14)
As of 2015-07-06 19:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (81 votes), past polls