in reply to lpr command from perl not working.

$cmd ends up containing C:\ABCDEFGH.txt

You perhaps wanted @cmd?

#!usr/bin/perl -w use strict; my @cmd=qw(lpr -S SYSTEMX -P QGPL/SPYVIEW -o l C:\\ABCDEFGH.txt); system(@cmd) or die "cannot do this: $!";

Replies are listed 'Best First'.
Re^2: lpr command from perl not working.
by smanicka (Scribe) on Feb 11, 2009 at 21:30 UTC
    I did that and now it doesnt give the actual usless something 7 times.But it still says cannot do this at line 4
      system() returns the exit value of the command being run, which (on *nix systems, anyway) will be zero on success, so "system($foo) or bar()" will do bar() when $foo succeeds, not when it fails.
        Would it be better if i assigned the value to a variable, tested it to check if its a 0 or a 1 and then did my error reporting? BTW i can concurrently check the as400.And I havent recieved the file