Subject: | Strange failure when running under perl -d |
(Run under AS 5.8.6 on WinXP)
I have an app that uses an Attribute::Handlers based module. While
trying to debug the app/module, when running under "perl -d", I get the
following error when A::H attempts to resolve a freshly declared variable:
test_count set to 2
Test 1
Can't use an undefined value as a symbol reference at
C:/Perl/lib/Attribute/Hanlers.pm line 16.
at C:/Perl/lib/Attribute/Handlers.pm line 16
Attribute::Handlers::findsym('main', 'SCALAR(0x1b6e5cc)') called
at C:/Perl/lib/Attribute/Handlers.pm line 180
Attribute::Handlers::_apply_handler_AH_('ARRAY(0x1c3475c)',
'CHECK') called at C:/Perl/lib/Attribute/Handlers.pm line 146
Attribute::Handlers::__ANON__[C:/Perl/lib/Attribute/Handlers.pm:165]('main',
'SCALAR(0x1b6e5cc)', 'Sociable') called at C:/Perl/lib/attributes.pm line 6
attributes::import('attributes', 'main', 'SCALAR(0x1b6e5cc)',
'Sociable') called at t\02shared_attr.t line 52
Debugged program terminated. Use q to quit or R to restart,
use O inhibit_exit to avoid stopping after program termination,
h q, h R or h O to get additional info.
DB<1>
The statement that causes the failure is
my $foo : Sociable = 'foo';
Note that this seems to work fine when not run under the debugger.
I tried to step thru the failing method; it appears there might be a
timing issue wrt when lexicals get installed in the symbol table under
the debugger ?
I've worked around the issue by declaring attributes directly (no A::H),
so I don't think its anything inherent in my code.
Needless to say, this issue makes using A::H a bit challenging...