%[
#!/usr/interp/perl -w

# <STDIN> IN LIST CONTEXT
# By Louis Ziantz

# Description: This program is a demonstration of reading
#              from STDIN into an array.
# Procedure:   Several lines are read from input and
#             the array is output several ways.
# Input:       Lines of text from STDIN.
# Output:      Array read from STDIN in several ways.

print("Type several lines followed by a <control>D ...\n");
@a = <STDIN>;
# @a is ("<STDIN> in list context.\n", 
#        "Each element of @a gets a line of input.\n",
#        "Like so.\n")
print("Result of print(\@a); ... \n");
print(@a);
print("Result of print(\"\@a\"); ... \n");
# an easier way to print the same message
# print('Result of print("@a"); ...', "\n");
print("@a");
%]



