Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

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

by rvosa (Curate)
on Jul 20, 2006 at 08:32 UTC ( #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
Node Status?
node history
Node Type: note [id://562520]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (8)
As of 2021-01-25 21:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?