Hello all,

I am having a little trouble with the action command 'a'
under recent perls.

For example when i use the following little program with the
'a' (action) command in recent perls (up to 5.11.3) under linux,
I am getting an unexpected warning message, after control leaves
the scope of the subroutine. It looks to me as if the
evaluation of the action is done at the wrong place
(as $arg is not in scope anymore after 'return').

Can this be written into a test?
Thanks, Heiko

use strict; use warnings;


sub greet
        my $arg = shift;
        print "$arg\n";

A debugging session with an action that prints $arg, before the subroutine returns, follows. Please note the warning message at
the end.

he...@heiko-desktop:~/perl/my_tests$ perl5.11.3 -wd simple.pl

Loading DB routines from perl5db.pl version 1.33
Editor support available.

Enter h or `h h' for help, or `man perldebug' for more help.

sigwarn handler installed!
main::(simple.pl:3):    greet('Hello');
  DB<1> a 9 print " \$arg = $arg\n"
  DB<2> c 9
main::greet(simple.pl:9):               return;
 $arg = Hello
  DB<3> s
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.
Use of uninitialized value $arg in concatenation (.) or string at (eval 8)[/home/heiko/localperl/lib/5.11.3/perl5db.pl:638] line 1.
 $arg =

Reply via email to