in reply to subroutine ref while "strict refs"
ormy %checkers = map {; no strict 'refs'; $_ => \&$_ } qw( check_char check_time check_date check_numeric );
Then in the loop,my %checkers = map { $_ => \&$_ } # \&$_ is except from strict refs. qw( check_char check_time check_date check_numeric );
my $checker_name = $rec_layout_hash{$fields[0]}{$i}{"sub_routine"}; my $checker = $checkers{$checker_name} or die("Unrecognized checker $checker_name\n"); $checker->($value1, $value2);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: subroutine ref while "strict refs"
by Anonymous Monk on Jul 28, 2014 at 20:22 UTC | |
by ikegami (Patriarch) on Jul 28, 2014 at 21:17 UTC | |
|
Re^2: subroutine ref while "strict refs"
by viffer (Beadle) on Jul 29, 2014 at 03:32 UTC |