in reply to Re: Return statement in subroutine(s) is necessary when not returning anything?
in thread [SOLVED] Return statement in subroutine(s) is necessary when not returning anything?

Hello stevieb,

Thank you for your time and effort reading and replying to my question. Well yeah you are right, it is easier and better way of coding to place a return; (void) to show that your subroutine ends there.

But also as Anonymous pointed out, it is better to return (void) instead of implicit return.

That been said I have my answer to my question. Thank you for your time and effort it helped to clear out my thought.

Seeking for Perl wisdom...on the process of learning...not there...yet!

Replies are listed 'Best First'.
Re^3: Return statement in subroutine(s) is necessary when not returning anything?
by stevieb (Canon) on Nov 02, 2015 at 23:05 UTC
    Yes, explicit return with void is better than implicit return. It makes your API more reliable. Later tonight I'll dig up and update this post as to why explicit exits are important as well...

      Hello again stevieb,

      Yeah that would be great, please do post anything you find. More info is always welcome. :D

      Seeking for Perl wisdom...on the process of learning...not there...yet!