I don't understand why you had to use 'map' to pass the regular expressionYou could use map inside your sub, if you prefer.
Is it because when you run get_data( map { "^$_" @ids } ), it is like doing get_data( "^john" ) and that is being passed to the subroutine?Not exactly. The map is like doing:
get_data( '^john' , '^james' );
In reply to Re^3: Passing Regex Pattern in Subroutine
by toolic
in thread Passing Regex Pattern in Subroutine
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |