[LON-CAPA-cvs] cvs: modules /gerd neutrino.pl

www lon-capa-cvs-allow@mail.lon-capa.org
Tue, 18 Mar 2008 13:17:48 -0000


www		Tue Mar 18 09:17:48 2008 EDT

  Added files:                 
    /modules/gerd	neutrino.pl 
  Log:
  The search for the neutrino
  
  

Index: modules/gerd/neutrino.pl
+++ modules/gerd/neutrino.pl
use strict;
use GDBM_File;
my %hash;
if (tie(%hash, 'GDBM_File', "/home/batchelo/sfu_4l16328ec8e4b4773sfulc.db", &GDBM_READER(), 0640)) {
   foreach my $key (keys %hash) {
      my $printkey=&unescape($key);
      my $printvalue=&unescape($hash{$key});
      unless (($printkey=~/ionic\.simp\.bin\.hypo\.form\.XZ\.problem/) && 
              ($printkey=~/submission/)) { next; }
      $printvalue=~s/\W/\*/gs;
      print "$printkey:$printvalue:\n";
   }
} else {
   print "Tie failed!\n";
}
untie(%hash);

sub unescape {
    my $str=shift;
    $str =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C",hex($1))/eg;
    return $str;
}