Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Inappropriate ioctl for device error on system call

by neilwatson (Curate)
on Dec 12, 2006 at 20:58 UTC ( #589412=note: print w/ replies, xml ) Need Help??


in reply to Inappropriate ioctl for device error on system call

Problem solved. Enscript's return status is more than simply zero or not zero:
RETURN VALUE Enscript returns value 1 to the shell if any errors were encountered. On successfull termination, the return code is constucted from the following flags: 0 no errors or warnings 2 some lines were truncated or wrapped 4 some characters were missing from the used fonts 8 some characters were unprintable
Would something like
system("/bin/somecommand") < 9 or die "Somecommand failed $!, $?";
Work?

Neil Watson
watson-wilson.ca

Replies are listed 'Best First'.
Re^2: Inappropriate ioctl for device error on system call
by sgifford (Prior) on Dec 20, 2006 at 06:41 UTC
    The basic idea is right, but $! won't be set by the command exiting with a nonzero exit status (t will be left at whatever the last error happened to be), and $? is the actual exit value times 256, for a normal exit. See system and $! variable for more details.

    Here's an example to try out to see what I mean:

    perl -e 'unlink("nosuchfile"); system("sh","-c","exit 1") == 0 or die "Err: $!,$?"' Err: No such file or directory,256 at -e line 1.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://589412]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (4)
As of 2016-06-27 05:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My preferred method of making French fries (chips) is in a ...











    Results (336 votes). Check out past polls.