Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: indexing an array

by Tortue (Scribe)
on Apr 05, 2001 at 20:41 UTC ( #70158=note: print w/replies, xml ) Need Help??


in reply to indexing an array

This may help get you started if you have trouble with unpack :
sub Read_File { # An array of arrays to store the results my @items = (); while(<CLAIMS>) { # Extract the three fields into an array # and store a reference to it in @items push @items, [unpack("a8a6a2", $_)]; } # Display (for example) the 3d field in the 2nd line: print $items[1][2]; }
Updated : This is the same as tadman's AoA solution above and mr.nick's below...

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (6)
As of 2022-08-18 11:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?