http://qs321.pair.com?node_id=1166309


in reply to Re^2: naming anonymous subroutines inner variables
in thread naming anonymous subroutines inner variables

Works for me:
#!/usr/bin/env perl use 5.014; use strict; use warnings; my $self; for my $k (qw(foo bar baz)) { $self->{$k} = sub { return join $k, @_ }; $self->{"f_$k"} = sub { my $self = shift; return $self->{$k}->(@_); }; } for my $k (qw(foo bar baz)) { say $self->{"f_$k"}->($self, qw(a b c)); } __END__ afoobfooc abarbbarc abazbbazc
It would be more productive if you would show something we could actually run.