sweetblood has asked for the wisdom of the Perl Monks concerning the following question:
The code I'm working with(doesn't work) is as follows:
#!/usr/bin/perl -w use strict; our %rets; open(RL, "</home/myftplog") || open (RL, "<h:\\myftplog") || die "$!\n"; while (<RL>) { chomp; next if /^$/; my ($fn, $rl, $mle, $rce, $mlfn, $mlln, $mlac, $mlpn, $ml2e, $ml2fn, $ml2ln, $ml2pn, $retname, $ml2ac, $rc2e, $fc, $retid, $scrname, $exec, $freq, $fnum) = split /:/; if ($fnum eq ""){ my $fnum = "_001"; } %rets = ( ${retid}.${fnum} => { FNAME => $fn, RECLEN => $rl, LIAISON_EMAIL => $mle, LIAISON_FNAME => $mlfn, LIAISON_LNAME => $mlln, LIAISON_AREACODE => $mlac, LIAISON_PHONE => $mlpn, LIAISON2_EMAIL => $ml2e, LIAISON2_FNAME => $ml2fn, LIAISON2_LNAME => $ml2ln, LIAISON2_PHONE => $ml2pn, RETNAME => $retname, RETAILER_EMAIL => $rce, LIAISON2_AREACODE => $ml2ac, RETAILER2_EMAIL => $rc2e, FTPCHECK => $fc, RETID => $retid, SCRIPT_NAME => $scrname, EXECFLAG => $exec, FREQUENCY => $freq, FILE_NUMBER => $fnum } ); } close RL; foreach my $id (keys %rets) { print "$id\n"; }
when I execute this I get no errors. However I only have one record in %rets. I thought I would have had a separate reference to each %rets=>$retid.$fnum
I'm very confused. I do tink I'm close but I still need help!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Hash of anonymous hashes --- Oh my
by !1 (Hermit) on Nov 17, 2003 at 18:41 UTC | |
by sweetblood (Prior) on Nov 17, 2003 at 19:43 UTC | |
|
Re: Hash of anonymous hashes --- Oh my
by Limbic~Region (Chancellor) on Nov 17, 2003 at 18:48 UTC | |
by allolex (Curate) on Nov 17, 2003 at 18:57 UTC | |
by Limbic~Region (Chancellor) on Nov 17, 2003 at 18:59 UTC | |
| A reply falls below the community's threshold of quality. You may see it by logging in. |