Help for this page

Select Code to Download


  1. or download this
     The escape sequence \Q ...\E  quotes, or protects most non-alphabetic
    + characters. For instance,
    
       1. $x = "\QThat !^*&%~& cat!";
       2. $x =~ /\Q!^*&%~&\E/; # check for rough language
    
    It does not protect $ or @ , so that variables can still be substitute
    +d.
    
  2. or download this
    use warnings;
    use strict;
    
    print "Yes!\n" if ( '$@' =~ m|\$\@| ); 
    # prints "Yes!"
    
  3. or download this
    use warnings;
    use strict;
    ...
        print "\'$string\' did not match...\n";
    }
    # prints "'@@@' did not match..."