in reply to "scalar found where operator expected" while printing to a glob ref
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: "scalar found where operator expected" while printing to a glob ref
by seki (Monk) on Mar 01, 2016 at 17:56 UTC | |
by AnomalousMonk (Archbishop) on Mar 01, 2016 at 18:25 UTC | |
by seki (Monk) on Mar 01, 2016 at 21:36 UTC | |
by Eily (Monsignor) on Mar 02, 2016 at 08:16 UTC | |
by seki (Monk) on Mar 02, 2016 at 13:18 UTC | |
by MidLifeXis (Monsignor) on Mar 03, 2016 at 18:30 UTC |