It seemed like a reasonable thing to do. But apparently I had never tried it or had simply forgotten that, "The undef function is a unary operator, not a list operator, so you can only undefine one thing at a time." (Camel Book) So, I settled for the less elegant (in my mind),undef ($from, $to) if $from > $to
But I got to thinking, what would have been so bad about allowing undef to undefine a list of variables? I'm hard-pressed to think of any inconsistencies or ambiguities that might crop up if such a construct were allowed. After all, my can declare a list of variables. It seems logical that if you wanted to wipe that same list clean later, a parallel construction would be a clear and handy thing to have.$from = $to = undef if $from > $to
So, any ideas why this limitation exists in Perl?
20050201 Considered: holli: move to meditations, unconsidered by Corion: 13/19/0 - no decision
In reply to undef a List of Variables by Dr. Mu
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |