...then...~/perl/monks$ cat foo.txt sub{"fish $_[0]"};
$foo_from_file = do "foo.txt"; foo("This is test 1\n", qr/test (.*)/, $foo_from_file); sub foo { (my $text = $_[0]) =~ s/$_[1]/$_[2]->($1)/e; print $text; }
In reply to Re^4: How do I pass $1 to s///?
by Anonymous Monk
in thread How do I pass $1 to s///?
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |