The usual rant about using lexical filehandles will come shortly
So as not to disappoint the choroba: always use lexical filehandles!!! (and the 3-argument form of open).
Further to kcott's exemplary sample code, which uses the recommended 3-argument form of open with a lexical filehandle, note that lexical filehandles are automatically closed at end of scope (used here to illustrate how Perl garbage collection differs from Java).
In reply to Re^2: file open with variables
by eyepopslikeamosquito
in thread file open with variables
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |