The argument of print is just a list or array and so
-
print "Hello"," Rest", "of World"; # or
-
print @fred; # are legal
|
One can read in a whole array to a list where each entry of list is one line of file. For instance one can set @file to be all of standard input by:
-
@file = <STDIN>; # We will learn how to do for arbitrary files
|
As mentioned, double quoted strings use variable interpolation for arrays as in
-
$string = "This is a full list @fred \n";
-
$string = " First value in fred list is $fred[0] \n";
-
Slices and variable indices can also be used in variable interpolation
|