Hello seki. print doesn't take an arbitrary expression as a filehandle, it's either a scalar variable, a direct filehandle (bareword) or a block. To quote the doc:
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, in which case the LIST may not be omitted.
In reply to Re: "scalar found where operator expected" while printing to a glob ref
by Eily
in thread "scalar found where operator expected" while printing to a glob ref
by seki
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |