Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: "Subroutine basics" What does -1 mean ?

by jeffa (Bishop)
on May 29, 2014 at 15:28 UTC ( [id://1087824]=note: print w/replies, xml ) Need Help??


in reply to "Subroutine basics" What does -1 mean ?

"What's the meaning of exit -1 here ?"

No one has explicitly stated this yet, but the only way to know the answer is to ask the person who designed the code. Convention would say that return value should signal that the subroutine call failed in some way, but who is to say that the person who created this code was following convention? Your best hint is to inspect all the lines of code that call that subroutine and find a common pattern. Once you figure that out, remove the silly return codes and add some REAL exceptions instead.

jeffa

L-LL-L--L-LL-L--L-LL-L--
-R--R-RR-R--R-RR-R--R-RR
B--B--B--B--B--B--B--B--
H---H---H---H---H---H---
(the triplet paradiddle with high-hat)

Replies are listed 'Best First'.
Re^2: "Subroutine basics" What does -1 mean ?
by mr_mischief (Monsignor) on May 29, 2014 at 20:27 UTC

    Add some real exceptions to the process handling of the OS? What shell do you run? Can I try it?

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (3)
As of 2024-03-29 04:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found