sk found two problems, here's a couple more. Your mytool.pl line will not run without a path indication unless its directory is in your $PATH. Double quoting is undesirable since it will make the shell try to interpolate. This works for me,
$ cat >mytool.pl
#!/usr/bin/perl
print 'Substitute string';
$ chmod 755 mytool.pl
$ cat >test.tmpl
This is mytool.pl foo
$ perl -pe's/(mytool\.pl\b.*)/`.\/$1`/e' test.tmpl
This is Substitute string
$
It was necessary to escape '/' in the path because we used it for the substitution delimiter.
|