user-pic

Brad

  • About: I blog about PERLH^H^H^erl
Subscribe to feed Recent Actions from Brad

  • Ron Savage commented on Proposal: elseif be an alias for elsif (as in foreach and for)

    Hi All

    $many x $thanx for the replies.

    Reply-to: vsespb: It reduces pain, especially for beginners. No other reason needed :-).

    And, it's version-dependent. I also get:

    elseif should be elsif at - line 2.

    and I'm using 5.14.2.

    As soon as 5.18.2 comes out I'm upgrading to 'elseif' bliss (hopefully), even though I have /almost/ trained myself to always use elsif, and will need to stick to it in shipped modules (gasp). Looks like another pre-commit hook in git is on the cards.

    Well, the re-install of N too many modules won't be funny. And …

  • vsespb commented on Proposal: elseif be an alias for elsif (as in foreach and for)

    > Reply-to: vsespb: It reduces pain, especially for beginners. No other reason needed :-).

    Why not "elif" then? (for those who moved from Python)

    > I'm upgrading to 'elseif' bliss (hopefully),

    That will make your code harder to read/maintain for Perl and Ruby programmers (like me).

  • vsespb commented on Proposal: elseif be an alias for elsif (as in foreach and for)

    > As soon as 5.18.2 comes out I'm upgrading to 'elseif' bliss (hopefully)

    Why do you think "elseif" will be allowed in 5.18.2 ?
    it's not allowed in 5.19.3

  • flymike commented on A simple perl recursion example

    Your script is better, which need no concern for name or directory. Thanks.

  • 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/perl

    use v5.12.0;
    use warnings;

    say 'foo:'.($ARGV[0] // 'none');
    exec join(' ' ,$^X, $0 , $ARGV[0]+1) ;


Subscribe to feed Responses to Comments from Brad

About blogs.perl.org

blogs.perl.org is a common blogging platform for the Perl community. Written in Perl and offering the modern features you’ve come to expect in blog platforms, the site is run by Dave Cross and Aaron Crane, with a design donated by Six Apart, Ltd.