Unary equal?
blazar
created: 2006-05-03 06:41:53

While answering to [id://547098], 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($_ = )) {
    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...

Re: Unary equal?
created: 2006-05-03 06:51:42
My guess is that =split is interpreted as a POD tag, and discarded for that reason.
Re^2: Unary equal?
created: 2006-05-03 06:58:57

Indeed. Sorry!

perlmonks.org content © perlmonks.org and blazar, rhesa

prlmnks.org © 2006 edmund von der burg (eccles & toad)

v 0.03