split says:
When assigning to a list, if LIMIT is omitted, or zero, Perl supplies a LIMIT one larger than the number of variables in the list,
So while @arr = split gets a LIMIT of 0 (and stripping of trailing null fields), ($x, $y) = split gets a LIMIT of 3 (and no such stripping).
Another special case — potentially (as you, um, realized) surprising — but at least documented.
print "Just another Perl ${\(trickster and hacker)},"
The Sidhekin proves Sidhe did it!
In reply to Re^4: undef vs empty string '' from split
by Sidhekin
in thread undef vs empty string '' from split
by chrism01
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |