in reply to Debugging a system command

there are several modules on CPAN for quoting things, for instance:
use Scalar::Quote 'quote'; print "system(", join(", ", map { quote $_ } @cmd), ")\n" if $ENV{VERB +OSE};