PS H:\store\workspace\myTestCodes> cat ~/.perldb $DB::alias{b} = q# s/^b\s+(\$\w+)\s*$/'"b ". DB::CvGV_name('.$1.')'/ee; # PS H:\store\workspace\myTestCodes> cat .\test6.pl #!/usr/bin/env perl use 5.016; my $mysubref = sub { say "This is code Ref 0"; say "This is code Ref 1"; say "This is code Ref 2"; }; testMethod(); sub testMethod { say "in testMethod"; &{$mysubref}; } say "end the program"; PS H:\store\workspace\myTestCodes> perl -d .\test6.pl Loading DB routines from perl5db.pl version 1.37 Editor support available. Enter h or 'h h' for help, or 'perldoc perldebug' for more help. main::(.\test6.pl:8): }; DB<1> n main::(.\test6.pl:10): testMethod(); DB<1> b $mysubref DB<2> L b .\test6.pl: 10: testMethod(); break if ($mysubref) DB<3> c in testMethod This is code Ref 0 This is code Ref 1 This is code Ref 2 end the program 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<3> q PS H:\store\workspace\myTestCodes> perl -v This is perl 5, version 16, subversion 3 (v5.16.3) built for MSWin32-x86-multi-thread (with 1 registered patch, see perl -V for more detail) Copyright 1987-2012, Larry Wall Binary build 1603 [296746] provided by ActiveState http://www.ActiveState.com Built Mar 13 2013 11:29:21 Perl may be copied only under the terms of either the Artistic License or the GNU General Public License, which may be found in the Perl 5 source kit. Complete documentation for Perl, including FAQ lists, should be found on this system using "man perl" or "perldoc perl". If you have access to the Internet, point your browser at http://www.perl.org/, the Perl Home Page. PS H:\store\workspace\myTestCodes>