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

Re^2: use Switch wierdness

by tqisjim (Beadle)
on Aug 27, 2012 at 14:49 UTC ( #989996=note: print w/ replies, xml ) Need Help??


in reply to Re: use Switch wierdness
in thread use Switch wierdness

Muddling along with my project, I took two approaches:

  1. I took out a circular link, which was necessary anyways, to avoid global destruction.
  2. I'm no longer blessing $perldata- I'm oldschool enough to have learned on Perl4 anyways.

If I understand your explanation correctly, using a blessed or unblessed version of $perldata may only re-arrange an indeterminate destruction order, and therefore not a reliable solution. But then you took the same approach with your command line switch... Can you explain?

I also tested with the following code:

superman::DESTROY { warn "Blasted Kryptonite" ; }

Based on my observation, the superman object is destroyed when expected, after all the referencing objects. It's not that the references point to a destroyed object so much as the references themselves are getting clobbered. I'm probably digging too deep- If I have to think this hard in Perl, I must be taking the wrong approach.

Finally, thanks for the heads up about weak references. I was not aware of them.


Comment on Re^2: use Switch wierdness
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (6)
As of 2015-07-04 23:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (60 votes), past polls