While answering to Counting the number of items returned by split without using a named array, I did a little experiment, i.e.
$ perl -wlne '$x=split'
but for some strange reason on the first try I used double quotes instead of single ones (I'm under *NIX). So it was just like s/$x// and thinking of it retrospectively I would have thought it to cause a syntax error. But it seems that assignement into nothing is valid:
$ perl -MO=Deparse -Mstrict -wlne '=split' BEGIN { $^W = 1; } BEGIN { $/ = "\n"; $\ = "\n"; } LINE: use strict 'refs'; while (defined($_ = <ARGV>)) { chomp $_; } -e syntax OK
it just silently evaporates... wouldn't it be the case to issue at least a warning instead? Or are there good reasons not too! Offhand I can't think of any incompatibility with wanted beahaviour...
In reply to Unary equal? by blazar
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |