Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: reading the file using the line number

by ikegami (Patriarch)
on Nov 29, 2006 at 07:37 UTC ( [id://586633]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    tie my @array, 'Tie::File', $file_name
       or die("Unable to open file \"$file_name\": $!\n");
    
    print($array[$_])
       for 6, 1003, 2965;
    
  2. or download this
    my %lines_of_interest = map { $_ => 1 } 6, 1003, 2965;
    
    ...
          last unless --$num_lines;
       }   
    }
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (4)
As of 2024-03-29 07:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found