# a look at @ARGV.
if (@ARGV) {
my $count = @ARGV;
- my $str = "\'" . pop(@ARGV) . "\'";
- while ( my $param = pop(@ARGV) ) {
+ my $str = EMPTY_STRING;
+ foreach my $param (@ARGV) {
if ( length($str) < 70 ) {
- $str .= ", '$param'";
+ if ($str) { $str .= ', ' }
+ $str .= "'$param'";
}
else {
$str .= ", ...";
if ($rconfig_string) {
my @lines = split /^/, ${$rconfig_string};
print {*STDOUT} "# Dump of file: '$config_file'\n";
- while ( defined( my $line = shift @lines ) ) { print {*STDOUT} $line }
+ foreach my $line (@lines) { print {*STDOUT} $line }
}
else {
print {*STDOUT} "# ...no config file found\n";
my $in_string = EMPTY_STRING;
my $out_string = EMPTY_STRING;
- my @lines = split /^/, ${$rconfig_string};
- my $line_no;
+ my @lines = split /^/, ${$rconfig_string};
+ my $line_no = 0;
# loop over lines
- while (@lines) {
-
- my $line = shift @lines;
+ foreach my $line (@lines) {
$line_no++;
$line =~ s/^\s+//;
$line =~ s/\s+$//;
$quote_start_line_no = $line_no;
$quote_start_line = $line;
}
- elsif ( $in_string =~ /\G(#)/gc ) {
+ elsif ( $in_string =~ /\G#/gc ) {
# A space is required before the # of a side comment
# This allows something like:
if ( !length($out_string) || $out_string =~ s/\s+$// ) {
last;
}
- $out_string .= $1;
+ $out_string .= '#';
}
elsif ( $in_string =~ /\G([^\#\'\"]+)/gc ) {
last;
}
}
-
} ## end loop over line characters
if ( !$quote_char ) {
# Looking for something like $word, @word, $word[, $$word, ${word}, ..
while ( $text =~ / ([\$\@] [\$]*) \{?(\w+)\}? ([\[\{]?) /gcx ) {
+ ## ------1------ -2- ---3---
my $sigil_string = $1;
my $word = $2;
my $brace = $3;
$count_min = undef if ( !$saw_semicolon );
return;
};
- while ( my $ch = shift @chars ) {
+ while (@chars) {
+ my $ch = shift @chars;
if ( !defined($ch) ) { $saw_array->(); last }
elsif ( $ch eq '(' ) { last if ($count_min) }
elsif ( $ch eq ')' ) { last }
# Main loop over nested pairs...
# We are working from outermost to innermost pairs so that
# level changes will be complete when we arrive at the inner pairs.
- while ( my $item = pop( @{$rnested_pairs} ) ) {
+ while ( @{$rnested_pairs} ) {
+ my $item = pop @{$rnested_pairs};
my ( $inner_seqno, $outer_seqno ) = @{$item};
my $Kouter_opening = $K_opening_container->{$outer_seqno};
# always remove unwanted trailing blank lines from our list
return unless (@iblanks);
- while ( my $ibl = pop(@iblanks) ) {
+ while (@iblanks) {
+ my $ibl = pop @iblanks;
if ( $ibl < $iend ) { push @iblanks, $ibl; last }
$iend = $ibl;
}
# now mark mark interior blank lines for deletion if requested
return unless ($rOpts_kgb_delete);
- while ( my $ibl = pop(@iblanks) ) { $rhash_of_desires->{$ibl} = 2 }
+ while (@iblanks) {
+ my $ibl = pop @iblanks;
+ $rhash_of_desires->{$ibl} = 2;
+ }
return;
} ## end sub kgb_delete_inner_blank_lines
if ( $self->{_pod_cut_count} <= 1 ) {
$html_print->('<hr />');
}
- while ( my $rpre_string = shift @{$rpre_string_stack} ) {
+ while ( @{$rpre_string_stack} ) {
+ my $rpre_string = shift @{$rpre_string_stack};
$html_print->('<pre>');
$html_print->( ${$rpre_string} );
$html_print->('</pre>');
else {
# This will die if user's object does have a 'get_line' method
- while ( my $line = $line_source_object->get_line() ) {
+ my $line;
+ while ( defined( $line = $line_source_object->get_line() ) ) {
push( @{$rinput_lines}, $line );
}
$source_string = join( EMPTY_STRING, @{$rinput_lines} );
# ( or, for now, an =pod line)
my $msg = EMPTY_STRING;
my $in_code_skipping;
- while ( $line = $self->peek_ahead( $i++ ) ) {
+ while ( defined( $line = $self->peek_ahead( $i++ ) ) ) {
# if first line is #! then assume starting level is zero
if ( $i == 1 && $line =~ /^\#\!/ ) {
my $i = 0;
my ( $rpre_tokens, $rmap, $rpre_types );
- while ( $line = $self->peek_ahead( $i++ ) ) {
+ while ( defined( $line = $self->peek_ahead( $i++ ) ) ) {
$line =~ s/^\s+//; # trim leading blanks
next if ( length($line) <= 0 ); # skip blank
next if ( $line =~ /^#/ ); # skip comment
my $line;
my $i = 0;
- while ( $line = $self->peek_ahead( $i++ ) ) {
+ while ( defined( $line = $self->peek_ahead( $i++ ) ) ) {
$line =~ s/^\s+//; # trim leading blanks
next if ( length($line) <= 0 ); # skip blank
next if ( $line =~ /^#/ ); # skip comment
my $k = 0;
my $msg = "checking <<";
- while ( $line = $self->peek_ahead( $k++ ) ) {
+ while ( defined( $line = $self->peek_ahead( $k++ ) ) ) {
chomp $line;
if ( $line =~ /^$next_token$/ ) {