Beefy Boxes and Bandwidth Generously Provided by pair Networks vroom
Think about Loose Coupling
 
PerlMonks  

Re: Storing Text file in hash

by patgas (Friar)
on Mar 11, 2002 at 15:02 UTC ( [id://150954]=note: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


in reply to Storing Text file in hash

If the username is always different (which it probably would be), then something like this should get you started:
#!/usr/bin/perl -w use strict; use Data::Dumper; my %userinfo; while ( <DATA> ) { chomp; my ( $username, $realname, $password ) = split /\|/; $userinfo{$username} = { realname => $realname, password => $passw +ord }; } print Dumper \%userinfo; __DATA__ patgas|patrick|foobar doodle|what|now cannot|think|of better|sample|data
Update: forgot to chomp!

"We're experiencing some Godzilla-related turbulence..."

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://150954]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.