http://qs321.pair.com?node_id=11145702

mallett76 has asked for the wisdom of the Perl Monks concerning the following question:

I am trying to run a program using DBD and JDBC - So, when I ran the connection piece
use DBI; $dbh = DBI->connect("dbi:JDBC:hostname=$hostname;port=$port;url=$url", $user,$password);
It said "Can't locate Convert/BER.pm" - So, I went to C:\Perl_Newest\bin and double clicked on the CPAN batch file. It brought me to a command shell. Then it asked if I wanted to overwrite the lock on the C:\Perl_New and I did. Then I typed in INSTALL CONVERT::BER and it listed off a series of error messages to exited out. Messages were saying no success in downloading C:\Perl_New\cpan\sources\authors\01mailrtctxt.... So - why is it referencing C:\Perl_New - when the CPAN is in C:\Perl_Newest? Also - how can I go about installing the CONVERT::BER ?

Replies are listed 'Best First'.
Re: Can't locate Convert/BER.pm
by Tux (Canon) on Jul 25, 2022 at 14:26 UTC

Unless Windows, most of the rest of the world of automation is case-sensitive, and Convert::BER is not the same as CONVERT::BER (and probably never will be). I expect the second link to return you a 404.

Enjoy, Have FUN! H.Merijn
> Unless Windows, most of the rest of the world of automation is case-sensitive

maybe it's relevant here to remark that use on WIN will show a split personality.

the require will be case insensitive but the import will fail, because the latter expects a case sensitive package name

this will lead to somehow schizophrenic error conditions.

C:\tmp\pm>perl -MData::Dumper -we"print Dumper [1..3]" # Correct C +asing, NO Problems \$VAR1 = [ 1, 2, 3 ]; C:\tmp\pm>perl -MdAtA::DuMpER -we1 # NO Error +Msg on Win C:\tmp\pm>perl -MdAtA::DuMpER -we"print Dumper [1..3]" # BUT won't + work! Name "main::Dumper" used only once: possible typo at -e line 1. print() on unopened filehandle Dumper at -e line 1. C:\tmp\pm>perl -MdAtA::DuMpER::FAKE -we1 # What we r +eally expected ... Can't locate dAtA/DuMpER/FAKE.pm in @INC (you may need to install the +dAtA::DuMpER::FAKE module) ... C:\tmp\pm>

Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery

Sorry - I probably should have stated. I have windows.

Nah, that was a giveaway :)

Just try again with the correct casing

Enjoy, Have FUN! H.Merijn
Re: Can't locate Convert/BER.pm
by soonix (Canon) on Jul 25, 2022 at 14:28 UTC
Your symptoms seem to indicate that, once upon a time, you installed Perl into C:\Perl_New, and later downloaded and unpacked (but not installed) to C:\Perl_Newest. What you should do now, depends on how you got there.

Getting back to the question "how did you install Perl?" - That I forget - it was so many years ago to be honest. However, I use Perl at my work. And, what ended up happening was, any time I switched a position in my company or received a new computer, I usually copied & pasted files that were in the C:\Perl_New & C:\Perl_Newest folders somewhere on our company network. And, then I simply copied & pasted my files to the new computer - and I really didn't have any issues. I use the C:\Perl_Newest - I don't use the C:\Perl_New

When I do perl -v from the command line, it says the below:

C:\Users\pMalle001>PERL -V Set up gcc environment - 3.4.5 (mingw-vista special r3) Summary of my perl5 (revision 5 version 16 subversion 3) configuration +: Platform: osname=MSWin32, osvers=5.2, archname=MSWin32-x86-multi-thread uname='' config_args='undef' hint=recommended, useposix=true, d_sigaction=undef useithreads=define, usemultiplicity=define useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=und +ef use64bitint=undef, use64bitall=undef, uselongdouble=undef usemymalloc=n, bincompat5005=undef Compiler: cc='C:\Perl_New\site\bin\gcc.exe', ccflags ='-DNDEBUG -DWIN32 -D_C +ONSOLE -DNO_STRICT -DPERL_TEXTMODE_SCRIPTS -DUSE_SITECUSTOMIZE -DPERL +_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DUSE_PERLIO -D_USE_32BIT_TIME_ +T -DHASATTRIBUTE -fno-strict-aliasing -mms-bitfields', optimize='-O2', cppflags='-DWIN32' ccversion='', gccversion='3.4.5 (mingw-vista special r3)', gccosan +dvers='' intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234 d_longlong=undef, longlongsize=8, d_longdbl=define, longdblsize=8 ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='__int64 +', lseeksize=8 alignbytes=8, prototype=define Linker and Libraries: ld='C:\Perl_New\site\bin\g++.exe', ldflags ='-L"C:\Perl_New\lib\CO +RE"' libpth=\lib libs=-lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 +-lshell32 -lole32 -loleaut32 -lnetapi32 -luuid -lws2_32 -lmpr -lwinmm + -lversion -lodbc32 -lodbccp32 -lcomctl32 -lmsvcrt perllibs=-lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvap +i32 -lshell32 -lole32 -loleaut32 -lnetapi32 -luuid -lws2_32 -lmpr -lw +inmm -lversion -lodbc32 -lodbccp32 -lcomctl32 -lmsvcrt libc=msvcrt.lib, so=dll, useshrplib=true, libperl=perl516.lib gnulibc_version='' Dynamic Linking: dlsrc=dl_win32.xs, dlext=dll, d_dlsymun=undef, ccdlflags=' ' cccdlflags=' ', lddlflags='-mdll -L"C:\Perl_New\lib\CORE"' Characteristics of this binary (from libperl): Compile-time options: HAS_TIMES HAVE_INTERP_INTERN MULTIPLICITY PERLIO_LAYERS PERL_DONT_CREATE_GVSV PERL_IMPLICIT_CONTEXT PERL_IMPLICIT_SYS PERL_MALLOC_WRAP PERL_PRESERVE_IVUV PL_OP_SLAB +_ALLOC USE_ITHREADS USE_LARGE_FILES USE_LOCALE USE_LOCALE_COLLATE USE_LOCALE_CTYPE USE_LOCALE_NUMERIC USE_PERLIO USE_PERL_ATOF USE_SITECUSTOMIZE Locally applied patches: ActivePerl Build 1603 [296746] Built under MSWin32 Compiled at Mar 13 2013 11:29:21 @INC: C:/Perl_Newest/site/lib C:/Perl_Newest/lib .

2022-08-18 Athanasius added code and paragraph tags.

Re: Can't locate Convert/BER.pm
by hippo (Bishop) on Jul 25, 2022 at 14:44 UTC
hippo said,
Have you read A guide to installing modules for Win32?

That guide is completely focused on ppm, which was mostly an ActiveState thing. Back in 2005, that was solid advice, since there was no Strawberry Perl yet, and ActiveState was still using ppm. But I thought that AS had moved away from that, and while Strawberry ships a ppm client, syphilis suggested in Re: Windows installation woes that ppm repositories have all but disappeared, and I cannot remember having used Strawberry's ppm since I started using Strawberry (which was at least 8 years ago).

mallett76 said,

So, I went to C:\Perl_Newest\bin and double clicked on the CPAN batch file. It brought me to a command shell. Then it asked if I wanted to overwrite the lock on the C:\Perl_New

That sounds like your CPAN.bat client in c:\Perl_newest\bin is still configured to install things in C:\Perl_new\, which is just a bad configuration on your part. I haven't really used the default CPAN client much, so I don't remember how to configure that specific setting, though IIRC o conf is the way to get started in changing CPAN configuration.

But which version/distribution of Perl are you using on your Windows machine? Is it a Strawberry? If so, is it an "installed" version that you rebased to c:\perl_newest, or did you just unzip the portable into c:\perl_newest? With Strawberry, I've found the easiest way to install Perl modules is using cpanm, not the default CPAN.bat client. If you are on Strawberry, I would suggest cpanm Convert::BER to try to install that module.

Or are you using an ActiveState distribution? Or did you compile your own? Which distro you are using , and whether you have cpanm or one of the other alternate CPAN clients available, determines the best advice to give to you. Sharing your perl -v will help us help you, as will the results of where perl & where cpan & where cpanm

Back in 2005, that was solid advice, ...

I'm sensing that this tutorial isn't as relevant as it once was. Would it be beneficial for someone familiar with MSWin32 to put together a more modern document to cover this important topic? Or has MS come far enough that the standard A Guide to Installing Modules is all the modern MSWin32 user needs?

🦛

No, I have not read "A guide to installing modules for Win32" However; I appreciate the link - and I plan on reading it.

Given the discussion which this topic has generated you might also (or instead) like to read A guide to installing modules for Win32 (2022 Edition) - your insights as someone who may be new to all this might help to improve that document as well. HTH.