in reply to How to pass a variable string as conditional argument to if statment

Does it really have to be a string?
my $var = sub { $_[0]->{this} eq 'that' }; foreach my $hash_ref (@a) { if ($hash_ref->{this} eq 'that') { ... } if ($var->($hash_ref)) { ... } }
  • Comment on Re: How to pass a variable string as conditional argument to if statment
  • Download Code