user-pic

Brad

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

  • 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) ;


  • 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

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 hosted by Dave Cross and Aaron Crane, with a design donated by Six Apart, Ltd.