i have a vexing problem for you....
the following does work fine:::
#dbmopen(%CARDREC, "testbase22", 0664)||
#die "can't dbmopen testbase with mode 0664";
open (IN, "test.in")||
die "can't open test.in";
$index=0;
foreach (<IN>){ $index++;
($index=1) if ($index>10);
chomp();
push(@card,$_) if ($index<10);
if ($index==10){
$CARDREC{$card[0]} = [@card];
print "$CARDREC{$card[0]}[0]\n\n";
print "@{$CARDREC{$card[0]}}\n\n";
@card=();}}
#dbmclose(%CARDREC);
the output is as follows::
------------------------------------------------
line one
line one line two line three line four line five line sixe line seven line
8 line 9
l11
l11 l12 l13 l14 l15 l16 l17 l18 l19
------------------------------------------------
but, when i uncomment for DBM statemnents as shown here:::
#!/usr/bin/perl -w
dbmopen(%CARDREC, "testbase22", 0664)||
die "can't dbmopen testbase with mode 0664";
open (IN, "test.in")||
die "can't open test.in";
$index=0;
foreach (<IN>){ $index++;
($index=1) if ($index>10);
chomp();
push(@card,$_) if ($index<10);
if ($index==10){
$CARDREC{$card[0]} = [@card];
print "$CARDREC{$card[0]}[0]\n\n";
print "@{$CARDREC{$card[0]}}\n\n";
@card=();}}
dbmclose(%CARDREC);
i get the following output::
------------------------------------------------
Use of uninitialized value in concatenation (.) or string at
./cardbase-0.1.0.pl line 14, <IN> line 21.
Use of uninitialized value in concatenation (.) or string at
./cardbase-0.1.0.pl line 14, <IN> line 21.
------------------------------------------------
after a lot of playing around... i think that my dbm syntax is
right... so i am just plain confused :(
----------------------------------------------------------------------
thanks :)
willy
--
Bill Gates is a man who loves EULAs,
If you break his contract he'll just sue ya',
If you do any sharing,
He'll set you to swearing,
So use GPL and shout 'booya'!!
-------------------------------------------------
This mail sent through IMP: http://horde.org/imp/
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]