I'm not aware of a convenient per-item combination. I hear that Perl 6 will have "hyper-operators" for that, when it reaches a stable release version >= 1.0.
I'd do that with a map, as I always use map when transforming one list into another:
@{$audit}{@$copy_fields} = map { defined $item->{$_} ? $item->{$_} : ' +' } @$copy_fields;
Your code will happily replace a value of "0" by "", and I guess that's not intended.
In reply to Re: ||= in Hash Slice
by Corion
in thread ||= in Hash Slice
by Brovnik
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |