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

Re: Reference to guard not released

by andal (Hermit)
on Jul 18, 2012 at 08:37 UTC ( #982387=note: print w/replies, xml ) Need Help??

in reply to Reference to guard not released

I can't explain what is happening, but I can offer work around :)

use strict; use Scope::Guard; my $x; my $code = do { my $tmp = sub { warn "destroyed"; $x ; }; my $g; sub { $g = Scope::Guard->new( $tmp ); } ; }; $code->(); undef $code; warn "end";

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://982387]
[sierpinski]: I've never seen $#$var before.
[LanX]: $list cops be an array ref
[LanX]: could
[LanX]: $#array gives the length
[LanX]: no sorry ...
[sierpinski]: so that would just be deferencing it...
[LanX]: the last index!
[LanX]: yes
[sierpinski]: yeah I guess $list is a reference.. yeah
[sierpinski]: why is it the last index and not the first? because the length of the array becomes the index?

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (14)
As of 2017-12-13 15:56 GMT
Find Nodes?
    Voting Booth?
    What programming language do you hate the most?

    Results (369 votes). Check out past polls.