Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re^2: reading the file using the line number

by Fengor (Pilgrim)
on Dec 01, 2006 at 12:22 UTC ( #587174=note: print w/ replies, xml ) Need Help??


in reply to Re: reading the file using the line number
in thread reading the file using the line number

sub extract { (my $filename, my $line_no)=@_; open (FILE, $filename) or die "$filename can't be opened: $! "; my $line = <FILE>; $. = $line_no; $line = <FILE> or die "Couldn't read line $line_no: $!"; return $line; }

--
"WHAT CAN THE HARVEST HOPE FOR IF NOT THE CARE OF THE REAPER MAN"
-- Terry Pratchett, "Reaper Man"


Comment on Re^2: reading the file using the line number
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (16)
As of 2014-07-24 19:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (165 votes), past polls