You can initialize in a declaration by assignment: my @recArray = <$fileHandle>; or local @recArray = <$fileHandle>; In array context, the diamond operator returns the entire content of the file, from the current position to the end, as a list of lines. You probably want lexical my instead of local here.
After Compline,
Zaxo
In reply to Re: Proper way to initialize local variables
by Zaxo
in thread Proper way to initialize local variables
by rzward
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |