in reply to strange behaviour in perl ..please explain
print "no" is an expression which returns 1 (print successful), and which prints no as a side effect. The (outer) print than has "yes", 1 as the argument list, so it prints yes1
The second example can be explained along the same lines: exit is evaluated before the print, and since it quits the program, the print isn't evaluated at all.
|
|---|