Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re^3: exit this way

by RonW (Parson)
on Sep 01, 2015 at 16:50 UTC ( [id://1140689]=note: print w/replies, xml ) Need Help??


in reply to Re^2: exit this way
in thread exit this way

In many other languages, main is "special". The unnamed programmers were attempting to make a facsimile of that "specialness".

Perhaps:

#!perl use strict; use warnings; main(); exit 99; # or other reasonable default exit value

might be better.

Replies are listed 'Best First'.
Re^4: exit this way
by Your Mother (Archbishop) on Sep 01, 2015 at 17:26 UTC

    Yes, and the attempt at the idiom is a reasonable idea, I have in fact used it for service/daemon style scripts in the past, but exit 0; # undef works too is the only "correct" exit code. Everything else is an error state. Since returning false is suggestive of an error in Perl I am reticent to put that lipstick on this pig... or this pig stick on those lips... And that's the way the news goes!

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (5)
As of 2024-04-20 16:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found