Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: printing specific lines

by esskar (Deacon)
on Feb 27, 2005 at 21:10 UTC ( [id://434926]=note: print w/replies, xml ) Need Help??


in reply to printing specific lines

as i understand: store the line number in a hash instead, so
my %lines = map { ($_, 1) } qw/1 3 5 7/; open(IN, "<grep") or die; while (<IN>) { print OUT $_ if $lines{$.}; }
HTH

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (7)
As of 2024-04-23 19:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found