Solved

AnyDBM_File problems

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
String Substitution 4 65
PERL get the value for query 4 139
Perl DBI Transactions Using Custom Module 7 41
create a gui in perl 3 46
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…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

746 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

13 Experts available now in Live!

Get 1:1 Help Now