Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: regex to split a line

by sulfericacid (Deacon)
on Jun 21, 2006 at 03:25 UTC ( #556570=note: print w/ replies, xml ) Need Help??


in reply to regex to split a line

Hi.

That looks like a tab to be so this is pretty easy.

# assuming @users contains your records of the text file my $userinfo; foreach my $user (@users) { my ($first, $last) = split(/\t/, $user); $userinfo{$first} = $last; }
This is how I'd do this, assuming the username is tab delimited.


"Age is nothing more than an inaccurate number bestowed upon us at birth as just another means for others to judge and classify us"

sulfericacid

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://556570]
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 2016-06-26 09:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My preferred method of making French fries (chips) is in a ...











    Results (328 votes). Check out past polls.