Skip to content

Commit

Permalink
Use regexp with Perl script builtin
Browse files Browse the repository at this point in the history
To comply with the perlcritic BuiltinFunctions::ProhibitStringySplit
policy.
  • Loading branch information
Julien-Elie committed Sep 4, 2024
1 parent bb2e1b3 commit 557e84c
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions contrib/authmysql.in
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ sub readconf {
$_ =~ s/#.*$//g;

if ($_ ne "") {
my ($key, $value_unused) = split(':', $_, 2);
my ($key, $value_unused) = split(/:/, $_, 2);
$config{$key} = $_;
}
}
Expand Down Expand Up @@ -114,7 +114,7 @@ sub get_stdin {
$_ =~ s/\s+//g;

if ($_ ne "") {
my ($key, $value) = split(':', $_, 2);
my ($key, $value) = split(/:/, $_, 2);
$retstdin{$key} = $value;
}
}
Expand Down
2 changes: 1 addition & 1 deletion contrib/fixhist.in
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ $count = 0;

while (<>) {
chop;
($msgid, $dates, $arts, $xtra) = split('\t');
($msgid, $dates, $arts, $xtra) = split(/\t/);
if ($xtra) {
&tossit(); # too many fields
next;
Expand Down
2 changes: 1 addition & 1 deletion control/perl-nocem.in
Original file line number Diff line number Diff line change
Expand Up @@ -750,7 +750,7 @@ sub logmsg($;$) {
# Write the message across several log lines.
$msg =~ s/\r/ /g;
my @logs = split('\n', $msg);
my @logs = split(/\n/, $msg);
if ($opt_l or not $syslog_available) {
if ($log_open == 0) {
Expand Down
10 changes: 5 additions & 5 deletions frontends/pullnews.in
Original file line number Diff line number Diff line change
Expand Up @@ -393,8 +393,8 @@ $NNTP_Args{'Timeout'} = $opt_N if defined $opt_N;
# Protocol debugging.
$NNTP_Args{'Debug'} = 1 if $debug >= 4;

@groupsToGet = map { s!^\s*(\S+)\s*!$1!; $_ } split(",", $opt_g) if $opt_g;
@groupsToAdd = map { s!^\s*(\S+)\s*!$1!; $_ } split(",", $opt_G) if $opt_G;
@groupsToGet = map { s!^\s*(\S+)\s*!$1!; $_ } split(/,/, $opt_g) if $opt_g;
@groupsToAdd = map { s!^\s*(\S+)\s*!$1!; $_ } split(/,/, $opt_G) if $opt_G;

$| = 1;

Expand Down Expand Up @@ -1051,12 +1051,12 @@ sub crossFeedGroup {
$unfolded_art_hdr .= $more_line;
}

my ($hdr_un, $val_un) = split(':', $unfolded_art_hdr, 2);
my ($hdr_un, $val_un) = split(/:/, $unfolded_art_hdr, 2);
$val_un = '' if not defined $val_un;
$val_un =~ s/^\s*//;
my $remove_hdr = 0;
for my $tuple_match (@hdr_to_match) {
my ($hdr_m, $val_m) = split(':', $tuple_match, 2);
my ($hdr_m, $val_m) = split(/:/, $tuple_match, 2);
my $negate_h = ($hdr_m =~ s/^!//);
my $remove_h = ($hdr_m =~ s/^#//);
next if lc($hdr_un) ne lc($hdr_m);
Expand Down Expand Up @@ -1086,7 +1086,7 @@ sub crossFeedGroup {
push @header_nums_to_go, $idx if $remove_hdr;
}

if (grep({ $curr_hdr eq $_ } split(':', $skip_headers))) {
if (grep({ $curr_hdr eq $_ } split(/:/, $skip_headers))) {
print LOG "\tDEBUGGING $i\tskip_hdr $idx\t$curr_hdr\n"
if $debug >= 2;
push @header_nums_to_go, $idx;
Expand Down
2 changes: 1 addition & 1 deletion frontends/scanspool.in
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@ sub check_spool {

# form an array of newsgroups, and retain them (in case of a
# folded Newsgroups header field)
push(@group, split(",", $aline));
push(@group, split(/,/, $aline));
$newsgroupsField = 1;
} elsif ($aline =~ /^\r?\n$/o) {
# end of headers
Expand Down

0 comments on commit 557e84c

Please sign in to comment.