Beefy Boxes and Bandwidth Generously Provided by pair Networks Bob
Perl: the Markov chain saw
 
PerlMonks  

perl5db - how to step into my sub without stepping into glob

by Anonymous Monk
on Jun 14, 2012 at 11:27 UTC ( #976182=perlquestion: print w/ replies, xml ) Need Help??
Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

My file p5dbglob.pl

#!/usr/bin/perl -- use strict; use warnings; Main( @ARGV ); exit( 0 ); sub Main { for my $dir ( @_ ){ chdir $dir or die $!; Fudge( $dir, glob '*' ); } } sub Fudge { my $dir = shift; my $count = @_; print "$dir => $count \n"; }

I want to step into Fudge() but without stepping into glob ( File::Glob::csh_glob ... ), but how?

Comment on perl5db - how to step into my sub without stepping into glob
Download Code
Re: perl5db - how to step into my sub without stepping into glob
by Anonymous Monk on Jun 14, 2012 at 11:37 UTC

    Ok, found the answer after asking the question, its s Fudge or s main::Fudge

    Before that I also found you can exit the subroutine you stepped into with r

    Thanks

      Heh. I go out of my way to *not* step into Fudge() :-)
Re: perl5db - how to step into my sub without stepping into glob
by chrestomanci (Priest) on Jun 14, 2012 at 15:46 UTC

    Looks like you have found one answer by providing a function name to s (step).

    Another way is to c <sub name> or b <sub name>

    Yet another method, is to edit the source to force a breakpoint. If you add DB::single = 1; to your code then the debugger will stop on the next statement.

    This can be very helpful if the fully qualified name of your function is not clear, or if it is dynamically compiled. It can be a problem though as once you set a breakpoint that way, you can't turn it off without editing your code again and restarting your program.

Re: perl5db - how to step into my sub without stepping into glob
by trwww (Curate) on Jun 14, 2012 at 19:23 UTC

    Along with the other suggestions, you can (s)tep and you will be in File::Glob::csh_glob, as you noted. If you then press (r)eturn, you'll be in Fudge.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://976182]
Front-paged by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (14)
As of 2014-04-16 08:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (418 votes), past polls