Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^2: Simple question about Inside-Out objects

by blazar (Canon)
on Mar 13, 2007 at 20:10 UTC ( #604672=note: print w/replies, xml ) Need Help??


in reply to Re: Simple question about Inside-Out objects
in thread Simple question about Inside-Out objects

refaddr() is used to be entirely agnostic about the bless status of an object.

Speaking of which (and I'm replying to you but ideally to all those who kindly answered my question, whom I thank), I was thinking that perhaps it would be nice if standard ref, just like so many functions, returned something different in list context, i.e. something like: REF, ADDR, BLESSED, where

  • REF would be ref()'s current output if the reference is not blessed, and if it is then the same as if it were not,
  • ADDR the same as refaddr()'s and
  • BLESSED the package the reference is blessed in, if it is, or undef otherwise.

But I suppose that such a beast would risk of breaking too much existing code...

Replies are listed 'Best First'.
Re^3: Simple question about Inside-Out objects
by diotalevi (Canon) on Mar 14, 2007 at 04:44 UTC

    Interestingly enough... UNIVERSAL::ref would allow you to override ref for some objects. There's no such thing as ref() in list context right now though.

    ⠤⠤ ⠙⠊⠕⠞⠁⠇⠑⠧⠊

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://604672]
help
Chatterbox?
[ambrus]: so there's an IO waiter (Prima::File) and a timer (Prima::Timer) maybe it's possible to write an AnyEvent loop driver over it, a saner one than POE

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (12)
As of 2016-12-07 16:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (130 votes). Check out past polls.