http://qs1969.pair.com?node_id=63055


in reply to Re: Re: Head to numb to see it.....
in thread Head to numb to see it.....

$s = 0; print $s ++ for 1..9;
Will not increment. Apparently, it depends on the context, whether the whitespace matters.

mkmcconn

update: danger, I'm sure you must be right about the prototyping of print().

Replies are listed 'Best First'.
Re: Re: Re: Re: Head to numb to see it.....
by danger (Priest) on Mar 08, 2001 at 23:02 UTC

    There have to be exceptions to every rule :-). This was obviously not the problem with the present question though. And, I am inclined think this is perhaps a little bug:

    sub blah { print shift; } blah($s ++) for 1 .. 9; # works fine blah $s ++ for 1 .. 9; # syntax error print $s ++ for 1 .. 9; # syntax error print($s ++) for 1 .. 9; # syntax error

    The latter print() case is probably related to print()'s prototype for optionally accepting a filehandle).