programming-examples/perl/Subroutine/Context and Subroutines.pl
2019-11-15 12:59:38 +01:00

9 lines
217 B
Perl

@now = localtime; # List context
print "@now\n"; # Scalar context
$now = localtime;
print "$now\n";
print localtime, "\n"; # prints in list context
print scalar localtime,"\n"; # Forced to scalar context