X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~mdw/git/mLib/blobdiff_plain/236f657b6dab66f31f4902cecfc03b4673f5bb98..7cf5c72a6d353ed5a7e340562c11e54c21c85e5e:/struct/sym-ref diff --git a/struct/sym-ref b/struct/sym-ref deleted file mode 100755 index c0a4622..0000000 --- a/struct/sym-ref +++ /dev/null @@ -1,40 +0,0 @@ -#! /usr/bin/perl -# -# Reference implementation for symbol table testing. - -%a = (); -while (<>) { - chomp(); - @F = split(); - if ($F[0] eq "set") { - $a{$F[1]} = $F[2]; - } elsif ($F[0] eq "get") { - if (exists($a{$F[1]})) { - print "$a{$F[1]}\n"; - } else { - print "*MISSING*\n"; - } - } elsif ($F[0] eq "del") { - if (exists($a{$F[1]})) { - delete($a{$F[1]}); - } else { - print "*MISSING*\n"; - } - } elsif ($F[0] eq "count") { - print int(keys(%a)), "\n"; - } elsif ($F[0] eq "show") { - if (!%a) { - print "*EMPTY*\n"; - } else { - my $s = ""; - foreach $k (sort(keys(%a))) { - print "$s$k:$a{$k}"; - $s = " "; - } - print "\n"; - } - } else { - print "*BAD*\n"; - } -} -