List and Scalar Contexts with print
@primes = (2,3,5,7,11);
print @primes; # List context
235711
print "@primes"; # Scalar context
2 3 5 7 11
print "Date: ", localtime(), "\n";
Date: 4737111689612591
print "Date: ", scalar localtime(), "\n";
Date: Wed Nov 28 13:55:01 2001
Previous slide
Next slide
Back to first slide
View graphic version