Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Parens mess up regex substitute

by BenHopkins (Sexton)
on Jan 26, 2012 at 04:04 UTC ( #950019=perlquestion: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    #!/usr/bin/perl
    use strict;
    ...
    print "(unescaped) path = $path\n";
    ($path = $str) =~ s{\Q$name\E}{};
    print "(escaped) path = $path\n";
    
  2. or download this
     str = /path/to/f(il)e
    name = f(il)e
    (unescaped) path = /path/to/f(il)e
    (escaped) path = /path/to/
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://950019]
Approved by lidden
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (5)
As of 2015-08-04 05:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The oldest computer book still on my shelves (or on my digital media) is ...













    Results (59 votes), past polls