http://www.perlmonks.org?node_id=616456


in reply to Re: Passing user input to a shell command
in thread Passing user input to a shell command

You should not be using qw in the system call

Or, you should be using qw() but you need to fully specify the path to perl. That way you don't have to worry about $file having spaces in it.

Replies are listed 'Best First'.
Re^3: Passing user input to a shell command
by jdporter (Paladin) on May 20, 2007 at 18:57 UTC

    Did you try this?

    print "$_\n" for qw "perl /Users/james/perlstuff/macc/macc1 $file";