by flatwhatson · 15y ago · 0 comments
my $block = sub { say "w00t, blocks!" };
my $closure = sub { $block->(); say "w00t, closures!" };
You'll have to look further for something Ruby does that Perl doesn't :) my $block = { say "w00t, blocks!" };
And there are also pointy blocks for neater stuff: my $pointy_block = -> $text { say "$text, blocks" };
$pointy_block("ne@t");Article just acted like that was a ruby invention (which they corrected)
My comment had nothing to do with perl.