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

Re: Line number in a file

by edan (Curate)
on Jul 06, 2004 at 09:58 UTC ( [id://372055]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    while (<MYFILE>)
    {
    ...
        $mylist{$1} = {value => $2, linenum => $. };
      }
    }
    
  2. or download this
    for my $key ( keys %mylist )
    {
    ...
    
      print "$key has value $value, found on line $linenum\n";
    }
    

Log In?
Username:
Password:

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

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

    No recent polls found