Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re^2: Execute shell command, grab it's return, terminate on timeout

by Haioken (Novice)
on Mar 21, 2014 at 03:08 UTC ( [id://1079160]=note: print w/replies, xml ) Need Help??


in reply to Re: Execute shell command, grab it's return, terminate on timeout
in thread Execute shell command, grab it's return, terminate on timeout

Hi Miller, Thanks for the suggestions.

1) It's probably left over from days of developing in C for Atmel MicroControllers. Limited memory partly means declaring as few as possible variables. Probably not so much an issue with my servers having >16Gb RAM.

2) No excuse for that one. Uhhh ... made sense at the time? :o)

3) I've made this change in my live code, though I'm not sure what circumstances would call it, as the other fails get reported via:

push(@return_val, $? >> 8);

The STDOUT data is already in @return_val (or @cmd), and the command above will give me the spawned process' exit code.

  • Comment on Re^2: Execute shell command, grab it's return, terminate on timeout
  • Download Code

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (2)
As of 2026-05-11 21:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.