From: "Parag Kalra" <paragka...@gmail.com>
Hi,
On shell, successful command returns exit status of 0.
As a best practice what status value shall a Perl function return.
Going by the fact that Perl function returns the value of last command
in it, I think function should return non-zero for a success.
Cheers,
Parag
Perl doesn't use functions, but subroutines or methods, so they don't need
to return something if you don't want them to return something.
If they return something they work like a function.
So the subroutines may return arrays or scalar variables which can also be
references to other kinds of variables if you need those variables as a
result of the subroutine.
If you just want to find if a subroutine returned true or false, you can
just return 1 or 0.
Octavian
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/