Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re^4: invoke shell with `` failed

by Porculus (Hermit)
on Apr 15, 2009 at 08:38 UTC ( [id://757590]=note: print w/replies, xml ) Need Help??


in reply to Re^3: invoke shell with `` failed
in thread invoke shell with `` failed

After some experimentation, I've managed to duplicate this error message -- but (on my system) it only happens when $dir is more than about two megabytes long! Are you sure $dir never changes?

The error is coming from the operating system; it can't be trapped with eval like I'd expected. However, you can determine whether the command succeeded by checking $?, which will be 0 if it worked and something else if it didn't. So I suggest what you do is change your code slightly:

my $available_space = `df $dir`; if ($? != 0) { warn "df failed: command was `df $dir`"; }

(and the equivalent in the other place where you use ``).

That should tell you exactly what is being considered "too long".

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (2)
As of 2024-04-25 23:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found