Solved

AnyDBM_File problems

Posted on 1997-03-24
2
242 Views
Last Modified: 2006-11-17
I'm running into a problem using the "use AnyDBM_File;" command so
I can use DBM type files in my script.  With the "use AnyDBM_File"
in my script, I run my script on the command line and it works fine.

However, when I try to run my script from a crontab entry I get an
error:

Your "cron" job

/usr2/epage/buildepagedbs.pl

produced the following output:

AnyDBM_File.pm did not return a true value at
/usr2/epage/buildepagedbs.pl line 55.
BEGIN failed--compilation aborted at /usr2/epage/buildepagedbs.pl line
55.

Line 55 is the "use" command line. Earlier today I was getting the
error message of "can't find AnyDBM_File.pm file".  I don't know
how this went away?

I'm running Perl 5.003 on Solaris 2.5.1:

epage01# /opt/PERL/perl5.003/bin/perl -V
Summary of my perl5 (5.0 patchlevel 3 subversion 0) configuration:
  Platform:
    osname=solaris, osver=2.5.1, archname=sun4-solaris
    uname='sunos epage01 5.5.1 generic_103640-05 sun4u sparc
sunw,ultra-1 '
    hint=recommended, useposix=true, d_sigaction=define
  Compiler:
    cc='cc', optimize='-O', gccversion=
    cppflags=''
    ccflags =''
    stdchar='unsigned char', d_stdstdio=define, usevfork=false
    voidflags=15, castflags=0, d_casti32=define, d_castneg=define
    intsize=4, alignbytes=8, usemymalloc=y, randbits=15
  Linker and Libraries:
    ld='cc', ldflags =''
    libpth=/lib /usr/lib /usr/ccs/lib
    libs=-lsocket -lnsl -ldl -lm -lc -lcrypt
    libc=/lib/libc.so, so=so
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=, ccdlflags=' '
    cccdlflags='-Kpic', lddlflags='-G'

@INC: /opt/PERL/perl5.003/lib/sun4-solaris/5.003 /opt/PERL/perl5.003/lib
/opt/PERL/perl5.003/lib/site_perl/sun4-solaris
/opt/PERL/perl5.003/lib/site_perl .
epage01#

Any help that you can give to me would be appreciated.

Thanks!
Randy Jew
Sr. Network Specialist
PG&E
0
Comment
Question by:rlj0
2 Comments
 
LVL 1

Accepted Solution

by:
icculus earned 50 total points
ID: 1203610
Try using one of the other DBM packages that are found in your
perl5 lib.

Personally I like the NDBM_File module. First check your
perl5 lib to make sure the NDBM_File.pm file is there,
if it is replace 'use AnyDBM_File.pm' with 'use NDBM_File.pm'.
If that doesn't work try the same thing with the SDBM_File.pm.

Another note, you might want to make sure that these DBM modules
are located in your @INC directories shown above. If you cannot
find any of the above mentioned modules in those directories
try a 'find' to see where they actually are. Then, push the
directory onto your @INC array to make sure the module is
found.

-Andy
0
 

Author Comment

by:rlj0
ID: 1203611
Tried all of your suggestions already.  The AnyDBM_File is supposed to pick the DBM package for you too.  By default it
will inherit NDBM.  Changing AnyDBM to NDBM made no difference
in my script.

All of the *.pm for NDBM, AnyDBM, SDBM, and ODBM was in my @INC
at /opt/PERL/perl5.003/lib where Perl installed it at.

I ended up reinstalling Perl 5.003, but I made the DBM libraries
static rather than dynamic during the build process.  This seemed
to fix my problem.  I can now use AnyDBM.

Thanks for your help!
Randy

0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In the distant past (last year) I hacked together a little toy that would allow a couple of Manager types to query, preview, and extract data from a number of MongoDB instances, to their tool of choice: Excel (http://dilbert.com/strips/comic/2007-08…
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…

827 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question