summaryrefslogtreecommitdiff
path: root/contrib/seg
diff options
context:
space:
mode:
authorBruce Momjian2012-07-05 01:47:49 +0000
committerBruce Momjian2012-07-05 01:47:49 +0000
commit042d9ffc282a8c796d2a5babc600c1a6db150dac (patch)
tree3204f89a7552bb9211aa9565f18367da150ffe60 /contrib/seg
parentd7c734841b3e6cb44de363a8a3d83c35b75b30d9 (diff)
Run newly-configured perltidy script on Perl files.
Run on HEAD and 9.2.
Diffstat (limited to 'contrib/seg')
-rwxr-xr-xcontrib/seg/seg-validate.pl56
-rwxr-xr-xcontrib/seg/sort-segments.pl29
2 files changed, 48 insertions, 37 deletions
diff --git a/contrib/seg/seg-validate.pl b/contrib/seg/seg-validate.pl
index 9272936aef2..cb3fb9a099a 100755
--- a/contrib/seg/seg-validate.pl
+++ b/contrib/seg/seg-validate.pl
@@ -2,12 +2,12 @@
$integer = '[+-]?[0-9]+';
$real = '[+-]?[0-9]+\.[0-9]+';
-$RANGE = '(\.\.)(\.)?';
-$PLUMIN = q(\'\+\-\');
-$FLOAT = "(($integer)|($real))([eE]($integer))?";
+$RANGE = '(\.\.)(\.)?';
+$PLUMIN = q(\'\+\-\');
+$FLOAT = "(($integer)|($real))([eE]($integer))?";
$EXTENSION = '<|>|~';
-$boundary = "($EXTENSION)?$FLOAT";
+$boundary = "($EXTENSION)?$FLOAT";
$deviation = $FLOAT;
$rule_1 = $boundary . $PLUMIN . $deviation;
@@ -18,25 +18,33 @@ $rule_5 = $boundary;
print "$rule_5\n";
-while (<>) {
-# s/ +//g;
- if ( /^($rule_1)$/ ) {
- print;
- }
- elsif ( /^($rule_2)$/ ) {
- print;
- }
- elsif ( /^($rule_3)$/ ) {
- print;
- }
- elsif ( /^($rule_4)$/ ) {
- print;
- }
- elsif ( /^($rule_5)$/ ) {
- print;
- }
- else {
- print STDERR "error in $_\n";
- }
+while (<>)
+{
+
+ # s/ +//g;
+ if (/^($rule_1)$/)
+ {
+ print;
+ }
+ elsif (/^($rule_2)$/)
+ {
+ print;
+ }
+ elsif (/^($rule_3)$/)
+ {
+ print;
+ }
+ elsif (/^($rule_4)$/)
+ {
+ print;
+ }
+ elsif (/^($rule_5)$/)
+ {
+ print;
+ }
+ else
+ {
+ print STDERR "error in $_\n";
+ }
}
diff --git a/contrib/seg/sort-segments.pl b/contrib/seg/sort-segments.pl
index 62cdfb1ffd7..a465468d5b8 100755
--- a/contrib/seg/sort-segments.pl
+++ b/contrib/seg/sort-segments.pl
@@ -2,19 +2,22 @@
# this script will sort any table with the segment data type in its last column
-while (<>) {
- chomp;
- push @rows, $_;
+while (<>)
+{
+ chomp;
+ push @rows, $_;
}
-foreach ( sort {
- @ar = split("\t", $a);
- $valA = pop @ar;
- $valA =~ s/[~<> ]+//g;
- @ar = split("\t", $b);
- $valB = pop @ar;
- $valB =~ s/[~<> ]+//g;
- $valA <=> $valB
-} @rows ) {
- print "$_\n";;
+foreach (
+ sort {
+ @ar = split("\t", $a);
+ $valA = pop @ar;
+ $valA =~ s/[~<> ]+//g;
+ @ar = split("\t", $b);
+ $valB = pop @ar;
+ $valB =~ s/[~<> ]+//g;
+ $valA <=> $valB
+ } @rows)
+{
+ print "$_\n";
}