In Tubleweed, the mptopdf perl script is broken. Whenever one runs mptopdf, it throws a tantrum and complains about -S not being an option known to the shell. So why is the shell executed rather than perl?
The original script from CTAN starts with the usual perl invocation magic:
which does not work. This person did not read the manual page for perl, which states specifically that perl executes the shell it finds on the #!-line if it does not find the word “perl”. So the magic code runs perl, perl parses the first line and sees “/bin/sh” and no mention of perl, and immediately runs /bin/sh with the same options it itself received.
The perlrun(1) manual page also explains how to fix this: add a second #! line that contains the word perl. So the correct invocation would be: