Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

AnyDBM_File problems

Posted on 1997-03-24
2
Medium Priority
?
248 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 1

Accepted Solution

by:
icculus earned 100 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

Enroll in October's Free Course of the Month

Do you work with and analyze data? Enroll in October's Course of the Month for 7+ hours of SQL training, allowing you to quickly and efficiently store or retrieve data. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

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

I've just discovered very important differences between Windows an Unix formats in Perl,at least 5.xx.. MOST IMPORTANT: Use Unix file format while saving Your script. otherwise it will have ^M s or smth likely weird in the EOL, Then DO NOT use m…
On Microsoft Windows, if  when you click or type the name of a .pl file, you get an error "is not recognized as an internal or external command, operable program or batch file", then this means you do not have the .pl file extension associated with …
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…
Six Sigma Control Plans

610 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