in reply to system commands aren't working as a loop.
qw(lpr -S SYSTEMX -P QGPL/SPYVIEW -o l $file)
means
(split(' ', 'lpr -S SYSTEMX -P QGPL/SPYVIEW -o l $file'))
Do you see the problem? If not, print out the contents of @cmd. Solution:
my @options = ( -S => 'SYSTEMX', -P => 'QGPL/SPYVIEW', -o => 'l', ); # Avoid being confused for an option. $file =~ s{^(?=-)}{./}; system(lpr => @options, $file)
|
|---|