mt2k has asked for the wisdom of the Perl Monks concerning the following question:
<code>
open FILE, "dir/filename.ext";
while (!eof(FILE)) {
$file = <FILE>;
@pairs = split(/&/, $file);
foreach $pair (@pairs) {
($user, $pass, $bgcolor, $fgcolor) = split(/:/, $pair);
$passwords{$fuser} = $fpass;
$bgcolors{$fuser} = $fbgcolor;
$fgcolors{$fuser} = $ffgcolor;
$usernames{$fuser} = $fuser;
}
}
<code>
Now how can I sort through these alphabetically and print them to the screen?
Thanks ahead of time. :-)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Alphabetically sorting hashes
by lhoward (Vicar) on Jun 02, 2000 at 23:37 UTC | |
|
Re: Alphabetically sorting hashes
by KM (Priest) on Jun 02, 2000 at 23:37 UTC | |
|
Re: Alphabetically sorting hashes
by cwest (Friar) on Jun 02, 2000 at 23:36 UTC |