in reply to Odd workings of split
Note that splitting an EXPR that evaluates to the empty string always returns the empty list.So it's not split that returns an undef, but the first element of the empty list that split returns (which is what you want to use) is undef.
I guess if you want to pass on an empty string (as opposed to undef) in such cases you would have to add a clause such as
$cmd[$_] //= "";
|
|---|