in reply to (Beginner) Can 'qw' be implemented into a list?
Now, if you have a data file containing lines of data, with perhaps 3 values per line, you might be wanting to load that into a some sort of data structure... perhaps an array of hashes... something like this?
my @SList = qw(Name Latitude Longitude); my @AoH; while (<FILE>) { chomp; my %hash; @hash{@SList} = split; # left-hand-side is called a "hash slice" push @AoH, \%hash; }
|
|---|