We've already seen how to read from standard input with
-
$line = <STDIN>; # return next line INCLUDING terminal newline
-
@file = <STDIN>; # return whole file with one line stored in each
|
We can also easily access the command-line arguments of a PERL program. Suppose we invoke a PERL program called makePHD at the command line with
-
% makePHD file1 file2 file3
|
We will see later how to process these arguments using standard argument-handling conventions in UNIX
|
However, the Perl diamond operator <> returns the concatenation of these three files. For example,
-
@files = <>; # concatenate file arguments and store in @files
|