Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • If the Counter / LazyIterator example was written in Perl 5, one would use 'sub { $count++ }', isn't it? Why the same method, i.e. 'sub { }' as circumfix operator for block in Perl 6?

    P.S. Would you resubmit this blog post to http://perlgeek.de/blog-en [perlgeek.de] for it to be easier to find?

    • If the Counter / LazyIterator example was written in Perl 5, one would use 'sub { $count++ }', isn't it? Why the same method, i.e. 'sub { }' as circumfix operator for block in Perl 6?

      Yeah, sub { } would be the nearest equivalent in Perl 5. It creates a reference to a closure. You can write that in Perl 6 as well, but the sub keyword gives the closure a bit more of a "shell", as outlined in this post [perl.org].

      P.S. Would you resubmit this blog post to http://perlgeek.de/blog-en [perlgeek.de] for it to be easier to find?

      If you want to read Moritz's and my blog posts in the same feed, I suggest you check out Planet Perl 6 [perl.org].