Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
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


Comment on Re: Inappropriate ioctl for device error on system call
Select or Download Code
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 romping around the Monastery: (6)
As of 2014-10-01 22:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    What is your favourite meta-syntactic variable name?














    Results (40 votes), past polls