Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Idiomatic Perl? -- eval qr/ /

by Discipulus (Canon)
on Mar 20, 2018 at 20:37 UTC ( [id://1211376]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    Gimme a string: a
    Gimme a RegEx: a(
    Unmatched ( in regex; marked by <-- HERE in m/a( <-- HERE / at .. line
    + .. <STDIN> line 2.
    
  2. or download this
    use strict;
    use warnings;
    ...
    
    print $str =~ /$rex/ ? "Yes!" : "No.";
    
  3. or download this
    perl -E "say 'match' if 'ec' =~ /$ARGV[0]/" "ec(?{print 'EVAL!';})"
    
    Eval-group not allowed at runtime, use re 'eval' in regex m/ec(?{print
    + 'EVAL!';})/ at -e line 1.
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (3)
As of 2024-04-25 09:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found