Hi all, first-time poster, mediocre Perl programmer.
I'm taking in a "|"-delimited file with predefined columns and want to turn it into an AoH for sorting. This works fine:
foreach (@array) {
@hash{qw<source_id exchange_id status exchange desc depth_flag dep
+th_indic>} = split /\|/;
push @AoH, {%hash};
};
I want to combine the two lines down to one, like this:
foreach (@array) {
push @AoH, { @{ qw<source_id exchange_id status exchange desc dept
+h_flag depth_indic> } = split /\|/} ;
};
...but I get the error:
Can't modify anonymous hash ({}) in list assignment at /home/omann/exch_list.pl line 66, near "/\|/;"
Is this possible?