I have used the following syntax that I found in the "Perl CD BookShelf" by O'Reilly (by the way, this CD is really fantastic).
Unfortunatly, I don't understand the return statement...
Can somebody explain this?
sub trim {
my @out = @_;
for (@out) {
s/^\s+//;
s/\s+$//;
}
return wantarray ? @out : $out[0];
}
Thanks,
Thierry
Unfortunatly, I don't understand the return statement...
Can somebody explain this?
sub trim {
my @out = @_;
for (@out) {
s/^\s+//;
s/\s+$//;
}
return wantarray ? @out : $out[0];
}
Thanks,
Thierry