in reply to Re^2: Debugger and lexicals
in thread Debugger and lexicals
As for my $a getting optimized away, I disagree with that because I just don't see how it can be optimized away when it's uninitialized in the subroutine. Here's a little test that I ran:
Here's the corrected script:#!/usr/bin/perl use strict; use warnings; print mt2(55), "\n"; my $a = 23; sub mt2 { my $b = $_[0] * 2; return $a + $b; }
This one works in the debugger. Thanks for the input.#!/usr/bin/perl use strict; use warnings; print mt2(55), "\n"; sub mt2 { my $a = 23; my $b = $_[0] * 2; return $a + $b; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Debugger and lexicals
by Anonymous Monk on Aug 07, 2011 at 11:59 UTC | |
by dave_the_m (Monsignor) on Aug 07, 2011 at 12:57 UTC | |
by Anonymous Monk on Aug 07, 2011 at 13:37 UTC | |
by dave_the_m (Monsignor) on Aug 07, 2011 at 15:35 UTC |