Solved

AnyDBM_File problems

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Reading fields from the text file. 4 92
compress files in RAR using perl 13 79
Transforming a Soap message to a simple xml message! 10 144
PERL - Find newest folder 12 118
Email validation in proper way is  very important validation required in any web pages. This code is self explainable except that Regular Expression which I used for pattern matching. I originally published as a thread on my website : http://www…
There are many situations when we need to display the data in sorted order. For example: Student details by name or by rank or by total marks etc. If you are working on data driven based projects then you will use sorting techniques very frequently.…
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…
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…

863 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now