programming-examples/perl/Subroutine/Wantarray function.pl
2019-11-15 12:59:38 +01:00

13 lines
194 B
Perl

#!/usr/local/bin/perl
@array = &mysub();
$scalar = &mysub();
sub mysub {
if (wantarray()) {
print ("true\n");
} else {
print ("false\n");
}
}