mark4444az has asked for the wisdom of the Perl Monks concerning the following question:
and then in the sub:$val1 = 'Torque\\sDriver\\sCS\#:\\s*(\\D{2}\\d{4})'; $tq = &val_search($val1);
I've tried every combination I can think of, does anyone have an idea of how to properly do this?sub val_search { my $ret_val = 0; { ($ret_val) = ($line =~ /$_[0]/); print "ret_val = ", $ret_val, "\n"; return $ret_val; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: passing a regex to a sub
by dominic01 (Sexton) on Nov 11, 2011 at 17:25 UTC | |
|
Re: passing a regex to a sub
by Praethen (Scribe) on Nov 12, 2011 at 02:47 UTC | |
|
Re: passing a regex to a sub
by wol (Hermit) on Nov 15, 2011 at 10:11 UTC |