Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Clawing my way out of operator overloading hell

by chunlou (Curate)
on Aug 01, 2003 at 01:37 UTC ( #279829=note: print w/ replies, xml ) Need Help??


in reply to Clawing my way out of operator overloading hell

I once used Aspect. I was trying to trace the double quotes operator (that's what's being called implicitly when using print). The following is an example.

use strict; use warnings; # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - use Aspect qw(advice calls returns around) ; my $aspect = advice( calls(qr/^(Quantum|main)::(.*)/), sub { printf "calling -> %s\n", $::thisjp->sub } ); $aspect->enable; # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - use Quantum::Entanglement; sub foo { my $die = entangle( 1=>1, 1=>2, 1=>3, 1=>4, 1=>5, 1=>6 ); print "$die" ; # observed state print "\n" ; } foo(); __END__ calling -> main::foo calling -> main::entangle calling -> Quantum::Entanglement::_new calling -> Quantum::Entanglement::("" calling -> Quantum::Entanglement::_normalise 3 calling -> Quantum::Entanglement::DESTROY calling -> Quantum::Entanglement::_rationalise_states calling -> Quantum::Entanglement::_unravel


Comment on Re: Clawing my way out of operator overloading hell
Download Code
Re: Re: Clawing my way out of operator overloading hell
by skyknight (Hermit) on Aug 01, 2003 at 16:28 UTC
    Interesting. Both your reply and ViceRaid's below are the kind of answers for which I was searching. In fact, it seems that the other comment-makers are right, in that the code was comparing two references directly, but this has been a good, all-around learning experience regardless. Fun stuff.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (5)
As of 2014-07-26 15:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (178 votes), past polls