[LON-CAPA-cvs] cvs: loncom /debugging_tools excise_from_db.pl
matthew
lon-capa-cvs@mail.lon-capa.org
Sat, 19 Mar 2005 00:39:54 -0000
matthew Fri Mar 18 19:39:54 2005 EDT
Modified files:
/loncom/debugging_tools excise_from_db.pl
Log:
A little error checking.
Index: loncom/debugging_tools/excise_from_db.pl
diff -u loncom/debugging_tools/excise_from_db.pl:1.1 loncom/debugging_tools/excise_from_db.pl:1.2
--- loncom/debugging_tools/excise_from_db.pl:1.1 Tue Jan 27 13:42:25 2004
+++ loncom/debugging_tools/excise_from_db.pl Fri Mar 18 19:39:54 2005
@@ -4,7 +4,7 @@
#
# excise_from_db.pl - Remove a key from a db file.
#
-# $Id: excise_from_db.pl,v 1.1 2004/01/27 18:42:25 matthew Exp $
+# $Id: excise_from_db.pl,v 1.2 2005/03/19 00:39:54 matthew Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -37,6 +37,12 @@
my $fname = shift;
my $key = shift;
+if (! defined($fname) || ! defined($key)) {
+ print "Specify db file and key on command line.".$/.
+ 'excise_from_db.pl roles.db "a very long key"'.$/;
+ exit;
+}
+
my %db;
if (! tie(%db,'GDBM_File',$fname,&GDBM_WRITER,0640)) {
warn "Unable to tie to $fname";