Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: subroutine ref while "strict refs"

by ikegami (Patriarch)
on Jul 28, 2014 at 19:43 UTC ( [id://1095412]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my %checkers =
       map {; no strict 'refs'; $_ => \&$_ }
          qw( check_char check_time check_date check_numeric );
    
  2. or download this
    my %checkers =
       map { $_ => \&$_ }   # \&$_ is except from strict refs.
          qw( check_char check_time check_date check_numeric );
    
  3. or download this
    my $checker_name = $rec_layout_hash{$fields[0]}{$i}{"sub_routine"};
    
    ...
       or die("Unrecognized checker $checker_name\n");
    
    $checker->($value1, $value2);
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1095412]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (8)
As of 2024-03-28 09:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found