I have Solaris 5.9, and am using Perl 5.6.1. Today I started using a 
hash connected to a file, via these commands: 
dbmopen(%data,"price2007",0666);
dbmclose(%data); 

I have been getting an error: 
"AnyDBM_File doesn't define an EXISTS method at extr.pl line 142". 

The lines in question are: 
                        if (exists $data{$k})
                                {
                                # Get data from file first. 
                                @a=split($SEP,$data{$k});
                                $a[3+(($jobpos-1)*4)]=$prfab;
                                $a[4+(($jobpos-1)*4)]=$prlthr;
                                }
                        else { # This is a new key. 
                                $a[3+(($jobpos-1)*4)]=$prfab;
                                $a[4+(($jobpos-1)*4)]=$prlthr;
                                $data{$k}=join($SEP,@a);
                                }

%data is defined as a global variable. I do not 'require' or 'use' any 
other files except my utility file 'util.pl'. Do I need to 'require' a 
file to use AnyDBM?

I'm pretty sure I have used 'exists' on a hash file before, but that was 
at least 2 years ago. I have not upgraded our Perl installation, I 
checked the dates. Is it possible our sysadmin updated Solaris, and that 
affected the DBM file libraries? 

OTOH, how do I check to see if a key exists in a hash tied to a file? 

Thanks.
Chuck

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to