0

I have written a perl script that parse SNMP traps from a tool and send them to messaging queue using curl.

The line of code that is misbehaving looks like this one below

$runcode=system(<the curl commands goes here>)

the successful execution of curl should return 0 other it should return the Curl's exit code (no zero value)

But even on the successful of curl I am getting 256 in the runcode ??

Any Suggestion to resolver this?

Tarik Setia
  • 73
  • 3
  • 12
  • The answer to the linked question says that exit code is multiplied by 256...but curl on successful execution returns 0...so the output should be 0... then why is it returning 256?? – Tarik Setia Mar 18 '15 at 20:48
  • `curl` says it returns 1 for unsupported protocols. If it works, then maybe `curl` isn't the last thing in your shell executes. Keep in mind that (`system($shell_command)` is really `system('sh', '-c', $shell_command)`. – ikegami Mar 19 '15 at 14:43

0 Answers0