How would it look if I used map? I know this isn't it ...sub add2array { my $ref2array = shift; my $obj = new THING; for my $thing ( sort keys $obj->things ) { push ( @{$ref2array} $thing ); } }
... or is it?$ref2array = map { push @{$_} } sort keys $obj->things;
In reply to How would I write this using map? by Plankton
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |