Richard Foley schrieb:
Just one thing, you might need to change the regex:

        if (   $dbline[$line] =~ m{\bgrep\b}xms
            || $dbline[$line] =~ m{\bmap\b}xms
            || $dbline[$line] =~ m{\bsort\b}xms
        ) {

to handle join and reverse as well:

        if ( $dbline[$line] =~ m{
                \b(grep|join|map|reverse|sort)\b
        }xms ) {

I tested 'grep', 'map', 'sort', 'join', and 'reverse' with single stepping 's' in the debugger.

Only the 'grep' and 'map' operators were always stopped for each array element,
probably because you must specify a block or an expression.

For 'sort', it depends on the compare function. None, or explicitly the default one are not interrupted,
if you supply your some other compare function, it will be interrupted.

'Join' and 'reverse' ran always in one step, probably because no code blocks are involved.
The combination of 'reverse' and 'sort' behaves like a single 'sort'.

So I think I will take your proposal and will leave out 'join' and 'reverse'.
Or did I miss something?
Maybe try a few single- and multi-line variations and, if it still looks good, submit a proposed patch to p5p?
Yes, I will do that. All is looking good.
I also checked
s expr
and
n expr

BTW:
with the definition
sub x1 {
   my $arg = shift;
   return reverse unpack "(a)*", $arg; }

if I single step through an expression
like this
s @x = x1('blabla')
s
s
...
(up to the end of function x1)
I never see the returned result. Neither in the debugger output,
nor in the variable @x. That is, when I do afterwards
x [EMAIL PROTECTED]
the array is empty.?!?!?
(ok, I just see, it is not empty, if @x has been used before,
what a weird behaviour, what is going on??? :-)

Greetings,
Heiko

Reply via email to