in reply to Reading file contents into an array

You're mixing two usages.

while (<$handle>) { ... } is used to read a file one record at a time and interpose programming instructions, usually based on content.

@foo = <$handle>; slurps a file, from current position to end, into an array of raw records, including the record seperator, $/, at the end of each except maybe the last.

Use the first if there is little context to preserve between records, the second if there is more complicated parsing to be done.

After Compline,
Zaxo