say "perl -pi -le 's/^\s+//; s/\s+\$//; s#\s+#\t#g;' file";
производит
Unrecognized escape \s passed through at -e line 1.
Unrecognized escape \s passed through at -e line 1.
Unrecognized escape \s passed through at -e line 1.
perl -pi -le 's/^s+//; s/s+$//; s#s+# #g;' file
Вы хотите
system("perl -pi -le 's/^\\s+//; s/\\s+\$//; s#\\s+#\\t#g;' file");
Собственно, зачем вообще вызывать оболочку?
system('perl', '-i', '-ple' 's/^\\s+//; s/\\s+$//; s#\\s+#\\t#g;', 'file');