@values = map { defined $_ ? $_ : '' } @values;
Update: don't use map for transforming something into itself. If you're getting from a different source, though, this would be an appropriate technique.
Caution: Contents may have been coded under pressure.
| [reply] [d/l] |
This looks great. However, I would be very pleased if somebody could describe it in English. ;>
| [reply] |
foreach (@values) {
$_ = '' unless defined;
}
That should be more clear. It updates each undefined element of @values to be the empty string.
Caution: Contents may have been coded under pressure.
| [reply] [d/l] |