http://www.perlmonks.org?node_id=1022167


in reply to Setting break point for particular condition in the subroutine

It sounds like you want to insert the breakpoint at the if ($cmd =~ /INITIAL/i) line. Let's say that's line 123. Then, type:

b 123 $cmd =~ /INITIAL/i

Setting it to the subroutine entry is problematic because $cmd isn't set yet (or at least isn't set to a member of @commands. In addition to that, simply using /INITIAL/i as your condition would be running that regexp on $_, not $cmd.

See perldebug for more info.