in reply to Modification of a read-only

The code @$x = map { $_ ||= "" } @$x; modifies the original values of @$x and the replaces @$x with those modified values. It is a bit redundant, like doing:

for( @$x ) { $_ ||= ""; } @$x= @$x;
Two good heuristics when using map:
  1. Don't use map in a void context
  2. Don't modify $_ inside of map
and you've broken rule 2 here.

This code @$x= map { defined($_) ? $_ : "" } @$x; avoids that problem.

        - tye (but my friends call me "Tye")