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: 54322220410321391
print "Date: ", scalar localtime(), "\n";
Date: Tue May 20 22:32:54 2003
Previous slide
Next slide
Back to first slide
View graphic version