Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
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


Comment on Re: regex to split a line
Download Code

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 making s'mores by the fire in the courtyard of the Monastery: (4)
As of 2015-07-04 17:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (60 votes), past polls