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

So my question is, is there any difference in using return statement if there is nothing to return from a subroutine?

Try it and see what happens, Basic debugging checklist , Data::Dump::dd()

using return ensures return gets to do what it does, not using return leaves it up to implicit return

  • Comment on Re: Return statement in subroutine(s) is necessary when not returning anything?

Replies are listed 'Best First'.
Re^2: Return statement in subroutine(s) is necessary when not returning anything?
by thanos1983 (Parson) on Nov 02, 2015 at 23:00 UTC

    Hello Anonymous,

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

    Thank you again for your time and effort.

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