tests: Improve portability for perl script tests.
Older versions of perl do not recognize the "-f" option, which I think
was just used by mistake anyway, so we can just remove it.
Sed commands like /foo/{g;p} are not portable; POSIX requires it to be
written like:
/foo/{
g
p
}
HP-UX 11 sed does not interpret "-f -" to mean "read the script from
standard input", as intended; it looks for a file called - instead.
There is little reason to do this, we can just quote the script
normally.
Fixing all this allows the tests to run on HP-UX 11.