J
jaialai technology
The code below is saved to a file called, say, temp.pl.
I run $perl temp.pl a b
and then I immediately run
$perl temp.pl c d
On this second run I expect to see the key 'a' of my first run but I
do not.
Why?
I am not getting any errors and the
associated db files are in /tmp
-rw-r--r-- 2 jt jt 12306 2010-12-04 14:53 test_db.dir
-rw-r--r-- 2 jt jt 12306 2010-12-04 14:53 test_db.pag
----
temp.pl
----
my %TEST_DATA;
dbmopen(%TEST_DATA,"/tmp/test_db",0666);
foreach my $key (keys %TEST_DATA){
print "$key\n";
}
$TEST_DATA[$ARGV[0]]=$ARGV[1];
dbmclose(%TEST_DATA);
I run $perl temp.pl a b
and then I immediately run
$perl temp.pl c d
On this second run I expect to see the key 'a' of my first run but I
do not.
Why?
I am not getting any errors and the
associated db files are in /tmp
-rw-r--r-- 2 jt jt 12306 2010-12-04 14:53 test_db.dir
-rw-r--r-- 2 jt jt 12306 2010-12-04 14:53 test_db.pag
----
temp.pl
----
my %TEST_DATA;
dbmopen(%TEST_DATA,"/tmp/test_db",0666);
foreach my $key (keys %TEST_DATA){
print "$key\n";
}
$TEST_DATA[$ARGV[0]]=$ARGV[1];
dbmclose(%TEST_DATA);