in reply to regex to split a line
Hi.
"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
That looks like a tab to be so this is pretty easy.
This is how I'd do this, assuming the username is tab delimited.# assuming @users contains your records of the text file my $userinfo; foreach my $user (@users) { my ($first, $last) = split(/\t/, $user); $userinfo{$first} = $last; }
"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
In Section
Seekers of Perl Wisdom