in reply to unless....else
if condition is true do clause
so you should read unless statements as
if condition is not true do clause
(of course perl lets you write those as do ... if too)
So in your example you're saying if 1 is not true, print hello. Since 1, by definition, is true, you'll always print "WHAT?!!!\n".
-derby
update Damn ... just re-read the OP and realized the big suprise wasn't that it didn't print "Hello" but that you could place an "else" block after "unless." The syntactic sugar part still holds (its just an if (! condition)) but sorry about the rest.
|
---|