in reply to Using a regex function from a hash
(updated to correct a typo - see reply below)my @dispatch = [ [ '\.vms', sub { my $fnam = shift; $fnam =~ s/\///g; return $fnam; } ] # ,[] ... ]; for ( my $v=0; $v <= $#view; $v++ ) { REGEXP: for ( my $d=0; $d <= $#dispatch; $d++ ) { if ( $view[$v] =~ /$dispatch[ $d ][0]/ ) { $view[$v]=&{$dispatch[$d][1]} ($view[$v]); last REGEXP; } } }
-M
Free your mind
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Using a regex function from a hash
by Anonymous Monk on Aug 03, 2006 at 17:34 UTC | |
by Moron (Curate) on Aug 04, 2006 at 15:09 UTC |