Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Is there any way to put regex modifiers into a variable?

by bart (Canon)
on Mar 12, 2018 at 08:17 UTC ( #1210700=note: print w/replies, xml ) Need Help??


in reply to Is there any way to put regex modifiers into a variable?

 print $line if ($line =~ /$regex/$opts);
Make that
print $line if ($line =~ /(?$opts:$regex)/);

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (4)
As of 2021-10-18 17:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My first memorable Perl project was:







    Results (74 votes). Check out past polls.

    Notices?