in reply to Re^5: Convenient way to use 5.10 features in perldebugger?
in thread Convenient way to use 5.10 features in perldebugger?

> What issues are you having with pre-prompt commands?

shouldn't

< use feature "say" work?

or shouldn't

< print "huhu" show a message?

UPDATE:

DB<3> < print "huhu" DB<4> DB<4> << pre-perl commands: << -- print "huhu" DB<5> h < < ? List Perl commands to run before each prompt. < expr Define Perl command to run before each prompt. << expr Add to the list of Perl commands to run before each pro +mpt. < * Delete the list of perl commands to run before each + prompt.

Cheers Rolf

Replies are listed 'Best First'.
Re^7: Convenient way to use 5.10 features in perldebugger?
by james2vegas (Chaplain) on Aug 15, 2010 at 18:23 UTC
    Sadly, no, they have their own scope:
    DB<9> < my $f = 42; DB<10> x $f 0 undef DB<11> << local $g = 15; DB<12> x $g 0 undef
      not a matter of scope...

      DB<32> < $main::a++ DB<33> print $main::a 5 DB<34> print $main::a 5 DB<35> print $main::a 5

      maybe the use is restricted to real debugging (breakpoints and so on ..) and not meant for interactive shells.

      Cheers Rolf

        Your code does not demonstrate your statement. Showing you can access the value of a global variable does not say anything about scope.
        > maybe the use is restricted to real debugging (breakpoints and so on ..) and not meant for interactive shells.

        actually that's the case, e.g. when stepping with n thru a program the pre- and post-prompt commands are executed.

        They are NOT executed when entering any perl lines.

        to test try something like  perl -de'for (1..1000) {0}' and type n.

        And BTW all these automatic commands have their own scope.

        Cheers Rolf