Help for this page

Select Code to Download


  1. or download this
    # The string these literals produce don't contains any "\".
    my $string = "my string with \ and / slashes."; 
    ...
    # It works.
    $string =~ s/\Q$substring\E/\"$substring\"/gi;
    print("$string\n");
    
  2. or download this
    my string with  and / slashes.
    with  and / slashes
    ...
    with \ and / slashes
    
    my string "with \ and / slashes".