Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: Why do I (sometimes) get a REF ref and not a SCALAR ref?

by ikegami (Patriarch)
on Jun 24, 2016 at 17:01 UTC ( [id://1166523]=note: print w/replies, xml ) Need Help??


in reply to Why do I (sometimes) get a REF ref and not a SCALAR ref?

The string is based on the referenced variable.

  • If the variable is a hash, the string is HASH.
  • If the variable is an array, the string is ARRAY.
  • If the variable contains an array, the string is REF.
  • ...
  • Otherwise, the string is SCALAR.

So,

  1. You are printing a reference to $a, which contains "foo": SCALAR
  2. You are printing a reference to $a, which contains \$a: REF
  3. You are printing a reference to $b, which contains "foo": SCALAR
  4. You are printing a reference to $a, which contains \$a: REF

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (7)
As of 2024-04-18 11:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found