Simple change of behavior or create new behavior:
#!/usr/bin/env perl use strict; use warnings; use feature qw(say); my $gizmo = frobnicate( sub { reverse split "", (shift) }, sub { uc(shift) } ); say $gizmo->("nose"); sub frobnicate { my ( $foo, $bar ) = @_; sub { $foo->( $bar->(@_) ) } }
«The Crux of the Biscuit is the Apostrophe»
In reply to Re: Anonymous subroutines
by karlgoethebier
in thread Anonymous subroutines
by Bod
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |