~/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; }