Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: correct usage of q, quotemeta, with s///

by Joost (Canon)
on May 31, 2002 at 09:36 UTC ( [id://170661]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my $string = 'abc!hu(';
    print "\Q$string\E\n";    # prints abc\!hu\(
    print quotemeta $string;  # prints abc\!hu\(
    
  2. or download this
    s/\Q$string\E/$replacement/;
    
    ...
    
    $qstring = quotemeta $string;
    s/$qstring/$replacement/;
    
  3. or download this
    perldoc perlre
    perldoc perlop (the m// part)
    
  4. or download this
    -- 
    Joost       downtime n. The period during which a system
                is error-free and immune from user input.
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (3)
As of 2024-04-20 03:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found