Brad
- About: I blog about PERLH^H^H^erl
Recent Actions
-
Commented on I want Package BLOCK syntax return 1.
https://metacpan.org/pod/true...
-
Commented on A simple perl recursion example
Very cool. But what if your perl is in a different path? :-o print "lel.\n"; system $^X . " $0"; Should take care of it for you....
-
Commented on Proposal: elseif be an alias for elsif (as in foreach and for)
Looks like Perl at least knows about it.. I get this elseif should be elsif at - line 2....
-
Commented on Proposal: elseif be an alias for elsif (as in foreach and for)
I was lucky(?) enough to start programming with Ruby, so the switch to "elsif" with Perl wasn't really an issue. "elseif" is very PHP-esque.. so I'm going to say no thank you to this one. However, I wouldn't mind "else...
Comment Threads
-
gautam.dey77 commented on
A simple perl recursion example
So, you solution would eventually run out of memory; or would hit the limit of number of processes your os will allow. If you really want it to be infinite; you should use exec; which would basically be doing a tail call optimization. (Since nothing after the exec will get called; and the process memory space is reused.)
#!/usr/bin/perluse v5.12.0;
use warnings;say 'foo:'.($ARGV[0] // 'none');
exec join(' ' ,$^X, $0 , $ARGV[0]+1) ;
-
fluca1978 commented on
I want Package BLOCK syntax return 1.
I guess you assume that every package is going into a separate file, and therefore a module to load. But if you define several packages into the same file unit, you are going to require Perl to conclude each block with useless return statements. While I cannot see a problem with that (from a practical point of view), I don't see a reason for having it too.
-
Yuki Kimoto commented on
I want Package BLOCK syntax return 1.
Brad
true is very interesting.
-
Yuki Kimoto commented on
I want Package BLOCK syntax return 1.
fluca1978
>I guess you assume that every package is going into a separate file.
No, package Foo { ...; 1;} package Bar { ...; 1;} have no problem.
>While I cannot see a problem with that (from a practical point of view), I don't see a reason for having it too.
My point is that 1; is strange specification and people tend to forget to write 1;. so I want to hide this strange specification in some way.
-
Yuki Kimoto commented on
I want Package BLOCK syntax return 1.
Brad
I use true module in mop::minus. This seem to be good.
https://github.com/yuki-kimoto/mop-minus-proposal
About blogs.perl.org
blogs.perl.org is a common blogging platform for the Perl community. Written in Perl with a graphic design donated by Six Apart, Ltd.