This works, because the filehandle has dereferenced. I think this is what is happening in your code - a filehandle is basically a reference to a file, and you are passing a reference _to_ that reference.

Edit: Check 'perldoc -f print': If you're storing handles in an array or hash, or in general
whenever you're using any expression more complex than a
bareword handle or a plain, unsubscripted scalar variable to
retrieve it, you will have to use a block returning the
filehandle value instead...