Hi Shlomi,
On Sun, Jun 23, 2013 at 10:02 AM, Shlomi Fish <shlo...@shlomifish.org>wrote: > Hi Tim, > > just a note. > > On Sun, 23 Jun 2013 09:39:48 +0100 > timothy adigun <2teezp...@gmail.com> wrote: > > > Hi lee, > > Please, check my comment below: > > > > On Sun, Jun 23, 2013 at 3:43 AM, lee <l...@yun.yagibdah.de> wrote: > > > > > James Alton <jamesalton...@gmail.com> writes: > > > > > > > lee, > > > > > > > > You have a post statement if and then a code block. You can only use > one > > > of > > > > two forms: > > > > > > > > print "test" if $color eq "blue"; #no parenthesis required > > > > if($color eq "blue"){print "test";} > > > > > > ++ > > > > > And I can't have 'last if $color eq "blue" print "test\n";'? That > would > > > be something quite natural and a logical thing to do ... > > > > > > logical? How is that? Wrap up, the function 'print' and 'last' in the > if > > statement like so: > > if( $color eq "blue"){ > > print "test\n"; > > last LABEL; > > } > > NOTE: That when last is used the loop in question is immediately exits > > and execution start at the LABEL statement if provided. So any code after > > the last function is not disregarded. > > > > "last" is not a function (a.k.a "subroutine") - it cannot be. It is a > special > statement which is handled in a special way by the Perl interpreter. > "redo" and > "next" are not functions either for a similar reason. > > ++. You are right. It's a keyword related to the control flow of Perl program. I mistook it for a function (a.k.a "subroutine") because I could use this "perldoc -f last" from CLI. Thanks for look out for me... :) > Regards, > > Shlomi Fish > > -- > ----------------------------------------------------------------- > Shlomi Fish http://www.shlomifish.org/ > Selina Mandrake - The Slayer (Buffy parody) - http://shlom.in/selina > > You can never truly appreciate The Gilmore Girls until you’ve watched it in > the original Klingon. > > Please reply to list if it's a mailing list post - http://shlom.in/reply . > -- Tim