The other day I was playing around with B::Deparse and its brethren as a debugging tool with a colleague. We were using it to have a look at the bug that I posted about in Funkyness with closures.... From there we started discussing modifiers and using this code
(called as perl -MO=Deparse cond.pl) We got the following:use strict; use warnings; my $cond=1; my $i=1 for $cond; for ($cond) { my $j=1; }
Which is of course _wrong_. My colleague used this to supposedly _prove_ that the modifier form is identical to the non-modifier form. I disagreed but had nowhere to go until we appended the following lines to the original script and then uncommented them one at a time. Guess which ones failmy $cond = 1; foreach $_ ($cond) { my $i = 1; } foreach $_ ($cond) { my $j = 1; }
Begin Update#comments added on update #print "$i/n"; # Works for input code, not output code #print "$j/n"; # Fails for both
To be honest any thoughts or comments at all about this stuff would be very welcome. And while I'm trawling the communal wisdom, any thought on using -d under NT would be apreciated as well.
Somewhat incoherent post, sorry...
Yves
--
You are not ready to use symrefs unless you already know why they are bad. -- tadmc (CLPM)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Regarding B::Deparse
by chromatic (Archbishop) on Oct 19, 2001 at 23:50 UTC | |
by demerphq (Chancellor) on Oct 20, 2001 at 14:59 UTC | |
|
Re: Regarding B::Deparse
by jackdied (Monk) on Oct 19, 2001 at 19:16 UTC | |
by demerphq (Chancellor) on Oct 19, 2001 at 19:22 UTC | |
|
Re: Regarding B::Deparse
by blakem (Monsignor) on Oct 19, 2001 at 21:26 UTC | |
by jynx (Priest) on Oct 20, 2001 at 00:55 UTC | |
by blakem (Monsignor) on Oct 20, 2001 at 01:41 UTC | |
by robin (Chaplain) on Dec 19, 2001 at 18:37 UTC | |
|
Re: Regarding B::Deparse
by IraTarball (Monk) on Oct 21, 2001 at 00:04 UTC |