Help for this page

Select Code to Download


  1. or download this
    foreach (qq/frog toad/, qq/man boy/, qq/woman girl/) {
        my ( $pattern, $substitution) = split /\s/, $_;
        $foo =~ s/\Q$pattern\E/$substitution/g;
    }
    
  2. or download this
    my %testhash = ( qw/frog toad man boy woman girl/ );
    foreach (keys %testhash) {
        $foo =~ /\Q$_\E/$testhash{$_}/;
    }