in reply to die in regexp

croak or die doesn't need to know the context in which it was called and it's going to exit anyway so in this context it doesn't seem any different from any other die, (if you'll excuse the pun), although it is a good habit to place brackets after function calls when they are used in any ambiguous 'literal vs. function' context such as this.

Therefore, to open the can of worms a little wider, consider whether loop control can reasonably be put in there, e.g. the following also worked as "expected" when I tested it on 5.6.1:

while(<>) { s/^\s*(\S)/$1 ne "#" ? $1 : next()/ge; # process non-comment line }
Update: And just how far can we take it? Can we define a sub in there? declare a variable with my? Or should we assume that anything not found in the documentation is unsupported. Personally I think it is better to document in a reliable context such as this can be proved to be.

-M

Free your mind