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

Re^5: I'm having a strange bug with basic file input. I'm a total newb.

by ikegami (Patriarch)
on Dec 05, 2008 at 11:36 UTC ( [id://728263]=note: print w/replies, xml ) Need Help??


in reply to Re^4: I'm having a strange bug with basic file input. I'm a total newb.
in thread I'm having a strange bug with basic file input. I'm a total newb.

unpack is better with fixed-width records
my ( $name, @tests ) = unpack( 'A20 A3 A3 A3 A3', $line );

With 5.8.0+, you can even do

my ( $name, @tests ) = unpack( 'A20 (A3)4', $line );

or

my ( $name, @tests ) = unpack( 'A20 (A3)*', $line );

Update: Heh, I hadn't noticed the bit about unpack at the bottom before posting.

Log In?
Username:
Password:

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

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

    No recent polls found