When you do open $teamAccts{$key}.. the expression $teamAccts{$key} refers to a reference to a GLOB.
When you put that into angles it should (from my point of view) be interpreted as a filehandle but for whatever reason it is not - rather it is treated as a glob-pattern that is first stringified (that gives the GLOB(...) value which is then "globbed". Because no file in the current directory matches that pattern, the pattern is returned.
This behaviour of glob is probably to mimik the broken glob-behaviour of shells:
whereas:perl -e print glob("hubba"); # prints "hubba" even if you don't have +a file "hubba"
So this is why <$teamAccts{$key}> returns GLOB(...) For my taste this is not simply a wart but a hunchback with a wart on top of perl...perl -e print glob("hubba*"); # prints nothing, provided no file matc +hes
You have tried to combine in a natural way two of perl's features (hashes and the angle-operator) and and were bitten by a total lack of orthogonality. Really nothing to boast about...
In reply to Re^2: FileHandles in a Hash (<> ambiguity)
by morgon
in thread FileHandles in a Hash
by Wiggins
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |