Help for this page

Select Code to Download


  1. or download this
    $possibly_safe = "^!|~¦¡£\0";
    $mystery_str = '$a !~ /qr^some|thing^';
    $mystery_str =~ tr!/!!d; # make eval interpolation safe
    eval "(\$safe = \$possibly_safe) =~ tr/$mystery_str//d";
    print $safe; # "¦¡£\0"
    
  2. or download this
    $possibly_safe = "^!|~¦¡£\0";
    $mystery_str = '$a !~ qr^some|thing^';
    eval "(\$safe = \$possibly_safe) =~ tr/$mystery_str//d";
    print $safe; # "¦¡£\0"