diff options
author | Peter Eisentraut | 2016-12-04 17:00:00 +0000 |
---|---|---|
committer | Peter Eisentraut | 2017-01-05 17:34:48 +0000 |
commit | 933b46644c787ed0b763532951961361e9304095 (patch) | |
tree | 1c739f122fd27ed237f1bdebdb3066b3ad99d3ab /contrib | |
parent | 175ff6598e014b2fe84c06fa443161294fc2eed0 (diff) |
Use 'use strict' in all Perl programs
Diffstat (limited to 'contrib')
-rwxr-xr-x | contrib/seg/seg-validate.pl | 35 | ||||
-rwxr-xr-x | contrib/seg/sort-segments.pl | 10 |
2 files changed, 26 insertions, 19 deletions
diff --git a/contrib/seg/seg-validate.pl b/contrib/seg/seg-validate.pl index cb3fb9a099..b8957ed984 100755 --- a/contrib/seg/seg-validate.pl +++ b/contrib/seg/seg-validate.pl @@ -1,20 +1,23 @@ #!/usr/bin/perl -$integer = '[+-]?[0-9]+'; -$real = '[+-]?[0-9]+\.[0-9]+'; - -$RANGE = '(\.\.)(\.)?'; -$PLUMIN = q(\'\+\-\'); -$FLOAT = "(($integer)|($real))([eE]($integer))?"; -$EXTENSION = '<|>|~'; - -$boundary = "($EXTENSION)?$FLOAT"; -$deviation = $FLOAT; - -$rule_1 = $boundary . $PLUMIN . $deviation; -$rule_2 = $boundary . $RANGE . $boundary; -$rule_3 = $boundary . $RANGE; -$rule_4 = $RANGE . $boundary; -$rule_5 = $boundary; + +use strict; + +my $integer = '[+-]?[0-9]+'; +my $real = '[+-]?[0-9]+\.[0-9]+'; + +my $RANGE = '(\.\.)(\.)?'; +my $PLUMIN = q(\'\+\-\'); +my $FLOAT = "(($integer)|($real))([eE]($integer))?"; +my $EXTENSION = '<|>|~'; + +my $boundary = "($EXTENSION)?$FLOAT"; +my $deviation = $FLOAT; + +my $rule_1 = $boundary . $PLUMIN . $deviation; +my $rule_2 = $boundary . $RANGE . $boundary; +my $rule_3 = $boundary . $RANGE; +my $rule_4 = $RANGE . $boundary; +my $rule_5 = $boundary; print "$rule_5\n"; diff --git a/contrib/seg/sort-segments.pl b/contrib/seg/sort-segments.pl index a465468d5b..04eafd92f2 100755 --- a/contrib/seg/sort-segments.pl +++ b/contrib/seg/sort-segments.pl @@ -2,6 +2,10 @@ # this script will sort any table with the segment data type in its last column +use strict; + +my @rows; + while (<>) { chomp; @@ -10,11 +14,11 @@ while (<>) foreach ( sort { - @ar = split("\t", $a); - $valA = pop @ar; + my @ar = split("\t", $a); + my $valA = pop @ar; $valA =~ s/[~<> ]+//g; @ar = split("\t", $b); - $valB = pop @ar; + my $valB = pop @ar; $valB =~ s/[~<> ]+//g; $valA <=> $valB } @rows) |