Perl WTFs – last in function

Monday 27 July 2009 @ 10:17 pm

Imagine you have a loop – and in that loop you call a function (sub) – your, or from some module. And imagine that someone by mistake left there “last” statement. What would it do? it will terminate your loop.

for … {



something… that would not be executed…


sub function {

something something…

last; # by mistake, maybe it should be a “return”?


For some people it is a WTF, for some it is very logical way , that it should work like.

What do you think about it?

Tags: , ,

Comments (0) - Posted in wtf,yapc by  

Warning: Creating default object from empty value in /home3/lech/public_html/ on line 1057

Leave a comment