And now for something completely different :)
#!/usr/bin/perl # https://perlmonks.org/?node_id=1230776 use strict; use warnings; ## pair up variables with sub_function. my @array = qw/ test test2 test3 /; my %easyily; for my $array ( @array ) { $easyily{$array} = sub { print "$array\n" }; } for my $array ( @array ) { $easyily{$array}() }
In reply to Re: call sub_function easily
by tybalt89
in thread call sub_function easily
by dideod.yang
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |