in reply to regex to split a line
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; }
|
---|