Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Re: Re: Unpredicted late destruction

by ferrency (Deacon)
on Nov 12, 2003 at 15:36 UTC ( #306541=note: print w/replies, xml ) Need Help??


in reply to Re: Re: Unpredicted late destruction
in thread Unpredicted late destruction

Thank you for the great example of a minimal failure case! And thanks for determining that this has already been fixed :)

I've discovered that the same problem exists for functions called in an if expression as well. Adding the following test to the bottom of your script does the wrong thing in 5.6.1 but the right thing in 5.8.0:

print "if: pre\n"; if (f()) { print "if: inside\n"; my $ifobj = bless ["if"]; } print "if: post\n";
Interestingly (to me, anyway), there didn't seem to be a problem with while() clauses:

print "while: pre\n"; while (f()) { print "while: inside\n"; my $wobj = bless ["while"]; last; } print "while: post\n";
This does the right thing on 5.6.1.

Thanks again!

Alan

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (6)
As of 2019-11-22 12:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Strict and warnings: which comes first?



    Results (111 votes). Check out past polls.

    Notices?