Hallo CK.
sub TRUE { 1; };
sub FALSE { 0; };
sub something { "something"; };
sub ary { qw(a b c d e); };print TRUE,"\n";
print FALSE,"\n";
print something,"\n";
print join(', ',ary),"\n";
Jepp, ich hab's gerade noch mal überflogen:
"The return value of a subroutine is the value of the last expression
evaluated by that sub, or the empty list in the case of an empty sub."
und weiter:
"If you specify no return value, the subroutine returns an empty list
in list context, the undefined value in scalar context, or nothing
in void context."
(http://www.perldoc.com/perl5.8.4/pod/perlsub.html#DESCRIPTION)
Also Korrektur der Korrektur (und jetzt hoffentlich endlich korrekt):
Die return-Anweisung muss dann angegeben werden, wenn etwas anderes als das Ergebnis des letzten Ausdrucks innerhalb der Subroutine zurückgegeben oder die Subroutine vorzeitig beendet werden soll.
Einigkeit erzielt?
Freundschaft!
Siechfred
Nichts ist schwerer einzureißen als die Mauer in den Köpfen.