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

Re^4: tie'ing a scalar as an array?

by rvosa (Curate)
on Jul 20, 2006 at 08:32 UTC ( [id://562520]=note: print w/replies, xml ) Need Help??


in reply to Re^3: tie'ing a scalar as an array?
in thread tie'ing a scalar as an array?

Thanks, that's cool!

Do I understand correctly that the lowercase methods can either be invoked on the scalar or the array (as both are blessed into the package), and therefore you sometimes have to retrieve the tied scalar from the array (if that happens to be the invocant)?

So, if you use, say, a $a->[0] construct, the STORE method is called on the array reference. STORE then invokes $a->lalala0 on the array, so the lalalao sub needs to retrieve the tied scalar from the invocant array.

Is that sort of how it works?

Replies are listed 'Best First'.
Re^5: tie'ing a scalar as an array?
by ruoso (Curate) on Jul 20, 2006 at 09:30 UTC

    Exactly.

    daniel

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (3)
As of 2024-04-26 03:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found