in reply to Re^3: Constants imported from other perl scripts doesn't want to exist :(
in thread Constants imported from other perl scripts doesn't want to exist :(
require() related:#!/usr/bin/perl use strict; eval 'use constant NAME_MAXLENGTH => 30' unless(defined(&NAME_MAXLENGT +H)); eval 'use constant LINK_MAXLENGTH => 256' unless(defined(&LINK_MAXLENG +TH)); eval 'use constant SUBJECT_MAXLENGTH => 256' unless(defined(&SUBJECT_M +AXLENGTH)); eval 'use constant POST_MAXLENGTH => 8192' unless(defined(&POST_MAXLEN +GTH)); 1;
Code snippet where the first error occurs (if it's commented, the next constant gets error'd):my $dir = dirname($ENV{"SCRIPT_FILENAME"})."/"; require("$dir.config_defaults.pl");
The error message:&error("Subject is too long/empty.") if (length $$subject > &SUBJECT_M +AXLENGTH || ($$subject eq "" && $mode eq "post"));
[error] -e: Undefined subroutine &ModPerl::ROOT::ModPerl::Registry::[v +ery long fullpath]post_2epl::SUBJECT_MAXLENGTH called at (eval 50) li +ne 195.\n
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: Constants imported from other perl scripts doesn't want to exist :(
by borisz (Canon) on Sep 17, 2005 at 20:48 UTC | |
|
mod_perl and BEGIN blocks
by rruiz (Monk) on Sep 18, 2005 at 10:37 UTC |