Solved

AnyDBM_File problems

Posted on 1997-03-24
2
240 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

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

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

Suggested Solutions

Many time we need to work with multiple files all together. If its windows system then we can use some GUI based editor to accomplish our task. But what if you are on putty or have only CLI(Command Line Interface) as an option to  edit your files. I…
A year or so back I was asked to have a play with MongoDB; within half an hour I had downloaded (http://www.mongodb.org/downloads),  installed and started the daemon, and had a console window open. After an hour or two of playing at the command …
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…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

810 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