in reply to getting the exact string used to call a perl script

It's possible, but that would require writing (or modifying) a shell.

It's the shell that's dealing with the quotes, perl is not passed the quotes. perl will be called by execve, with a 6 string array as second argument, the 6 strings being './my_ssh.pl', '-l', 'user', 'machine', 'the remote command' and the NULL pointer. (Sans quotes of course). perl will put the first element in $0, discard the NULL pointer, and pass the rest in @ARGV.

Why do you need to know how the string was quoted?

Perl --((8:>*
  • Comment on Re: getting the exact string used to call a perl script