Which one is good practice, a lexical filehandle or a typeglob?

Viewed 5389

Some say we should use a lexical filehandle instead of a typeglob, like this:

open $fh, $filename;

But most Perl books, including The Llama Book, use a typeglob, like this:

open LOGFILE, $filename;

So what are the differences? Which one is considered a better practice?

4 Answers
Related