http://www.perlmonks.org?node_id=994032

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

[apache@svn-old RGT3]$ /usr/local/bin/perl /usr/local/apache2/htdoc +s/RGT3/demandbuild-hotel.pl Hotel3.0 patch 14629 D ReleaseNotesCCR_14 +629D.txt emailid 201209171312 Not a subroutine reference at Modules/Util.pm line 35. Compilation failed in require at Modules/CheckCCRfiles.pm line 6. BEGIN failed--compilation aborted at Modules/CheckCCRfiles.pm line 6. Compilation failed in require at /usr/local/apache2/htdocs/RGT3/demand +build-hotel.pl line 8. BEGIN failed--compilation aborted at /usr/local/apache2/htdocs/RGT3/de +mandbuild-hotel.pl line 8.

I am getting this error we have withdrawn our code from backup also. no change in code which was running day before. Guess something wrong with perl installation or perl modules. Guess one developer was installing a perl module -File::Basename which was already installed may be did force install. Dont have any backup to see that. Can anyone help me diagnosis?have tried all this-

no warnings; use diagnostics -verbose; enable diagnostics;

Writing the code where getting error(though its working fine on another m/c

sub _load_constants { my %constants; foreach my $constant (@Modules::Constants::EXPORT,@Modules::Consta +nts::EXPORT_OK) { if (defined &{$Modules::Constants::{$constant}}) { $constants{$constant} = [&{$Modules::Constants::{$constant +}}]; if (scalar(@{$constants{$constant}}) == 1) { $constants{$constant} = @{$constants{$constant}}[0]; } } } return \%constants; } my $CONSTANTS_ref = _load_constants();

can anyone help me understanding what change has happened in perl modules/perl setup which i can diagnosis further. Have tried even cpan -update to update all the packages & got error-

perl NWCLARK/perl-5.8.6.tar.gz : make NO isa perl

Replies are listed 'Best First'.
Re: Not a subroutine reference
by greengaroo (Hermit) on Sep 17, 2012 at 14:16 UTC

    Can you post more of your code please? You have an error on demandbuild-hotel.pl line 8, probably on that line you use Modules::CheckCCRfiles; right? If not, can you post demandbuild-hotel.pl line 1 through 10 here? Put line 8 in bold if possible.

    Then, what is going on on Modules/CheckCCRfiles.pm line 6? Can we see that code? Your _load_constants method, is it from Modules/CheckCCRfiles.pm?

    And Modules/Util is a CPAN module right? Do you know which version you have?

    There are no stupid questions, but there are a lot of inquisitive idiots.
Re: Not a subroutine reference
by greengaroo (Hermit) on Sep 18, 2012 at 13:44 UTC

    If you find the solution on your own, can you please post it here? Thank you!

    There are no stupid questions, but there are a lot of inquisitive idiots.