summaryrefslogtreecommitdiff
path: root/lib/perl5db.pl
diff options
context:
space:
mode:
authorShlomi Fish <shlomif@shlomifish.org>2012-11-11 21:17:31 +0200
committerTony Cook <tony@develop-help.com>2013-01-02 11:21:59 +1100
commitbe43a6d374e53ec6fde940ef937916923fc94752 (patch)
tree8eb4c4e42f58801f866a4ecf97af9c9eeb83d7ca /lib/perl5db.pl
parent613bf352ae2d871a2a0088e5c8860143a3667963 (diff)
downloadperl-be43a6d374e53ec6fde940ef937916923fc94752.tar.gz
More refactoring.
Diffstat (limited to 'lib/perl5db.pl')
-rw-r--r--lib/perl5db.pl22
1 files changed, 8 insertions, 14 deletions
diff --git a/lib/perl5db.pl b/lib/perl5db.pl
index 8bb69d2855..cdf88269de 100644
--- a/lib/perl5db.pl
+++ b/lib/perl5db.pl
@@ -5645,38 +5645,32 @@ sub cmd_l {
my $line = shift;
# If this is '-something', delete any spaces after the dash.
- $line =~ s/^-\s*$/-/;
+ $line =~ s/\A-\s*\z/-/;
# If the line is '$something', assume this is a scalar containing a
# line number.
# Set up for DB::eval() - evaluate in *user* context.
if ( my ($var_name) = $line =~ /\A(\$.*)/s ) {
return _cmd_l_handle_var_name($var_name);
- } ## end if ($line =~ /^(\$.*)/s)
-
+ }
# l name. Try to find a sub by that name.
elsif ( ($subname) = $line =~ /\A([\':A-Za-z_][\':\w]*(?:\[.*\])?)/s ) {
return _cmd_l_handle_subname($cmd, $line);
- } ## end elsif ($line =~ /^([\':A-Za-z_][\':\w]*(\[.*\])?)/s)
-
+ }
# Bare 'l' command.
elsif ( $line !~ /\S/ ) {
return _cmd_l_empty();
}
-
# l [start]+number_of_lines
elsif ( my ($new_start, $new_incr) = $line =~ /\A(\d*)\+(\d*)\z/ ) {
-
return _cmd_l_plus($new_start, $new_incr);
- } ## end elsif ($line =~ /^(\d*)\+(\d*)$/)
-
+ }
# l start-stop or l start,stop
- elsif ( my ($start_match, $end_match) =
- $line =~ /^(?:(-?[\d\$\.]+)(?:[-,]([\d\$\.]+))?)?/ ) {
-
- return _cmd_l_range($cmd, $line, $current_line, $start_match, $end_match);
+ elsif (my ($s, $e) = $line =~ /^(?:(-?[\d\$\.]+)(?:[-,]([\d\$\.]+))?)?/ ) {
+ return _cmd_l_range($cmd, $line, $current_line, $s, $e);
+ }
- } ## end elsif ($line =~ /^((-?[\d\$\.]+)([-,]([\d\$\.]+))?)?/)
+ return;
} ## end sub cmd_l
=head3 C<cmd_L> - list breakpoints, actions, and watch expressions (command)