Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: Re: Re: Re: Re: split and sysread()

by runrig (Abbot)
on Apr 19, 2003 at 18:25 UTC ( [id://251691]=note: print w/replies, xml ) Need Help??


in reply to Re: Re: Re: Re: split and sysread()
in thread split and sysread()

Just a note: rather than split into a zillion variables, IMO it's more maintainable to list your field names in an array, then split into a hash variable:
my @fields = qw( serverhostname execdate etc. ); while (<INFILE>) { chomp; my %stuff; @stuff{@fields} = split /\|/; # Easy iteration over fields (e.g. for debugging) print "[$_][$stuff{$_}]\n" for @fields; }

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://251691]
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: (3)
As of 2024-04-16 14:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found