diff options
-rw-r--r-- | perllib/phash.ph | 26 | ||||
-rwxr-xr-x | phash.pl | 26 |
2 files changed, 26 insertions, 26 deletions
diff --git a/perllib/phash.ph b/perllib/phash.ph index 6b31f0a..5bc2744 100644 --- a/perllib/phash.ph +++ b/perllib/phash.ph @@ -170,32 +170,6 @@ sub gen_perfect_hash($) { } # -# Read input file -# -sub read_input() { - my $key,$val; - my %out; - my $x = 0; - - while (defined($l = <STDIN>)) { - chomp $l; - $l =~ s/\s*(\#.*|)$//; - - next if ($l eq ''); - - if ($l =~ /^([^=]+)\=([^=]+)$/) { - $out{$1} = $2; - $x = $2; - } else { - $out{$l} = $x; - } - $x++; - } - - return %out; -} - -# # Verify that the hash table is actually correct... # sub verify_hash_table($$) @@ -38,6 +38,32 @@ require 'phash.ph'; # +# Read input file +# +sub read_input() { + my $key,$val; + my %out; + my $x = 0; + + while (defined($l = <STDIN>)) { + chomp $l; + $l =~ s/\s*(\#.*|)$//; + + next if ($l eq ''); + + if ($l =~ /^([^=]+)\=([^=]+)$/) { + $out{$1} = $2; + $x = $2; + } else { + $out{$l} = $x; + } + $x++; + } + + return %out; +} + +# # Main program # sub main() { |