lblake has asked for the wisdom of the Perl Monks concerning the following question:
Hello, I am just learning perl and I have a question about return values? In the following perl script the message is printed out with or without the 'return' function why is that?
use strict; sub HowdyEveryone { my($name1, $name2) = @_; return "Hello $name1 and $name2.\n" . "Where do you want to go with Perl today?\n"; } print &HowdyEveryone("bart", "simpson");
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Returning values
by egga (Monk) on Sep 09, 2011 at 14:13 UTC | |
|
Re: Returning values
by afoken (Chancellor) on Sep 10, 2011 at 06:21 UTC | |
|
Re: Returning values
by Anonymous Monk on Sep 09, 2011 at 16:23 UTC | |
by lblake (Novice) on Sep 09, 2011 at 18:30 UTC |