owenmann has asked for the wisdom of the Perl Monks concerning the following question:
I want to combine the two lines down to one, like this:foreach (@array) { @hash{qw<source_id exchange_id status exchange desc depth_flag dep +th_indic>} = split /\|/; push @AoH, {%hash}; };
...but I get the error:foreach (@array) { push @AoH, { @{ qw<source_id exchange_id status exchange desc dept +h_flag depth_indic> } = split /\|/} ; };
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: pushing an anonymous hash onto an array on the fly
by SuicideJunkie (Vicar) on Feb 22, 2013 at 22:53 UTC | |
|
Re: pushing an anonymous hash onto an array on the fly
by choroba (Cardinal) on Feb 22, 2013 at 22:52 UTC |