in reply to How to clean an array of strings after a split
What is a better way of writing this code so that I'm sure all the variables in the array are at least defined or set to the empty stringWhat about using split /\|/, "$str|||||_" at the end?
$_ ||= ""in the map is redundant since the parts of the string that are split will always be definedThe || operator is different from the //. It tests for true, not definedness. ||= will replace signle zeros, too.
|
|---|