Arrays and Hashes
Reading Standard Input
- The assignment operator and the <STDIN>
operator can be combined with an array as well as a scalar.
- When used in an array context, the <STDIN>
operator will load all remaining lines from standard input into the
specified array.
- Loading continues until the end of pipe signal is recieved.
- End of pipe signals are generated from a Ctrl-D from a unix
command line, the end of file for a file, or the death of sending
process for a pipe.
- Example:
@FileContents = <STDIN>;
Back to Syllabus
Previous: Chomp
Next: Variable Interpolation of Arrays