Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re^5: Useless unless

by tilly (Archbishop)
on Aug 08, 2005 at 15:06 UTC ( [id://481908]=note: print w/replies, xml ) Need Help??


in reply to Re^4: Useless unless
in thread Useless unless

In Perl, all functions return a value unless normal processing is interrupted. The latter would include functions that die or exit.

Replies are listed 'Best First'.
Re^6: Useless unless
by sk (Curate) on Aug 08, 2005 at 16:46 UTC
    Thanks for the correction tilly! I should have known better. Agreed all functions return a value unless called in a void context!!!

    When i started to play around with BrowserUk's statement on functions that return a value (with explicit return in my case) I realized i did not have that in mind when i wrote for the otherwise idea... So did not reply back saying it will fail under that instance coz i am not using the return value either in my code. What i forgot in the process was that subs implicitly return the last expression evaluated and the problem of returning false will execute both functions even if an explicit return in not used

    I guess after reading jdporter's post and your question about functions returning false values, I guess it makes me feel otherwise will be a good feature if one want to write such conditional statements

    I know it is too late in the game to think about such additions but it is nice to discuss!

    -SK

Log In?
Username:
Password:

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

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

    No recent polls found