Help for this page

Select Code to Download


  1. or download this
    my $myVar='old yeller';
    my $b = 'cat $1 dog $2 mouse $myVar';
    ...
    
    # Use a substitution to replace the matched parts with $b
    s/(hello).+(wally).+/$b/;
    
  2. or download this
    s/(hello).+(wally).+/sub { $b =~ s/\$\d+/$$1/g; }/;