Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Dereference a reference to a file handle created with IO::File

by BillKSmith (Monsignor)
on Oct 28, 2020 at 02:17 UTC ( [id://11123246]=note: print w/replies, xml ) Need Help??


in reply to Dereference a reference to a file handle created with IO::File

Refer print:
FILEHANDLE may be a scalar variable containing the name of or a reference to the filehandle,...

UPDATE: Changed emphasis per Tobyink (below)

Bill
  • Comment on Re: Dereference a reference to a file handle created with IO::File

Replies are listed 'Best First'.
Re^2: Dereference a reference to a file handle created with IO::File
by tobyink (Canon) on Oct 28, 2020 at 08:41 UTC

    Yeah, this is a place you need to pay careful attention to the wording. It has to be a scalar variable, not just a scalar.

    Like foo() could return a scalar, and that scalar could be a reference to a filehandle. But print foo() "string\n" will fail because even though foo() evaluates to a scalar, it's not a scalar variable. Nor is $foo{'somekey'}.

    Same as you're not allowed to do:

    my %foo; for $foo{'somekey'} ( @arr ) { ...; }

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11123246]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (1)
As of 2024-04-24 23:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found