programming-examples/perl/Subroutine/Wantarray function.pl

13 lines
194 B
Perl
Raw Normal View History

2019-11-15 12:59:38 +01:00
#!/usr/local/bin/perl
@array = &mysub();
$scalar = &mysub();
sub mysub {
if (wantarray()) {
print ("true\n");
} else {
print ("false\n");
}
}