Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: passing a regex to a sub

by dominic01 (Sexton)
on Nov 11, 2011 at 17:25 UTC ( [id://937632]=note: print w/replies, xml ) Need Help??


in reply to passing a regex to a sub

Works for me
$val1 = qr/Torque\sDriver/i; $tq = &val_search($val1); sub val_search { my $line = "abcd Torque Driver efgh"; my $ret_val = 0; { ($ret_val) = ($line =~ /$_[0]/); print "ret_val = ", $ret_val, "\n"; return $ret_val; } }

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (4)
As of 2024-04-25 11:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found