BANG!
There's no need to assign names to array indices when you have Perl's hash
structure. Suppose your data is tab-separated, you could write:
my @data;
while (<>) {
my %record;
@record{qw(firstName lastName field3 field4)} = split /\t/;
push @data, \%record;
}
or something similar. No need for C in a Perl program.
HTH,
Rob
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/
Hm... What?
Looks like a good solution, I suppose.
OK... you make a temp hash, record.
@record{qw(firstName lastName field3 field4)} = split /\t/;
This line sorta confuses me.
Now record is treated as an array? An array element which is a hash?
On the next line, you push it as a hash onto @data. This makes an array of
hashes?