in reply to Re^2: Using an IO::File object stored in a Hash.
in thread Using an IO::File object stored in a Hash.
Simply stated, its because the diamond operator does dual service as both readline and glob. If the value or variable inside looks like a file handle at compile time, then it is interpreted and compiled as readline, if it doesn't, then it is interpreted and compiled as glob. At compile time a hash element is deemed more likely to contain a glob pattern than a filehandle.
As for why, you'd have to ask the author(s), but it is probably a throwback to when perl didn't have lexical filehandles; and it's never been seen as high enough priority to attempt a fix.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Using an IO::File object stored in a Hash.
by jjs04 (Novice) on Jan 20, 2017 at 19:14 UTC |