Gossamer Forum
Home : Products : Others : Gossamer Community :

mod_perl community "Useless use of a constant" error

Quote Reply
mod_perl community "Useless use of a constant" error
Thought it was time to get mod_perl up and running.

Hit a problem already on install.

When running www.domain.com/mod_perl/community/install.cgi

Apache error;
Useless use of a constant in void context at /usr/local/apache/www/domain/code/community/install.cgi line 8612. "my" variable $res masks earlier declaration in same scope at /usr/local/apache/www/domain/code/community/install.cgi line 8811

Line 8612: $i->{defaults}->{"Admin Email"} ||- 'webmaster@example.com';


# Force user to pick a sensible default. # $i->{defaults}->{"Private Path"} ||= $path . '/private'; $i->{defaults}->{"SMTP/Sendmail"}||= GT::Installer->find_sendmail(); $i->{defaults}->{"Path to Perl"} ||= GT::Installer->find_perl(); $i->{defaults}->{"Admin Email"} ||- 'webmaster@example.com'; return 1; }

Line 8811: my $res = $e->add_col(

# Add signup_ip_env and signup_env columns $i->print("\tAdding signup_ip_env column ... \n"); my $res = $e->add_col( comm_signup_env => { type => 'TEXT', form_display => 'Signup Environment' }, ); if ($res) { $i->print("\tOk.\n"); } else { $i->print("\tFailed: $GT::SQL::error\n"); } $i->print("Upgrade completed\n\n"); }
Quote Reply
Re: [catlovette] mod_perl community "Useless use of a constant" error In reply to
Mmm.. what happens if you change;

Code:
$i->{defaults}->{"Admin Email"} ||- 'webmaster@example.com';

to

Code:
$i->{defaults}->{"Admin Email"} ||= 'webmaster@example.com';

Does that make a difference?

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] mod_perl community "Useless use of a constant" error In reply to
yes it makes a difference.

Just get;

"my" variable $res masks earlier declaration in same scope at /usr/local/apache/www/ispy247.com/code/community/install.cgi line 8811.

8811: my $res = $e->add_col(
Code:

# Add signup_ip_env and signup_env columns $i->print("\tAdding signup_ip_env column ... \n"); my $res = $e->add_col( comm_signup_env => { type => 'TEXT', form_display => 'Signup Environment' }, ); if ($res) { $i->print("\tOk.\n"); } else { $i->print("\tFailed: $GT::SQL::error\n"); } $i->print("Upgrade completed\n\n");}


Im not clear what is going on here. Does this mean I could get other errors because im using mod_perl?
Quote Reply
Re: [catlovette] mod_perl community "Useless use of a constant" error In reply to
I'm not sure. This is version 1.0.1 you are trying to install? I think thats the latest version.

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] mod_perl community "Useless use of a constant" error In reply to
yes Andy its the latest 1.0.1
Quote Reply
Re: [catlovette] mod_perl community "Useless use of a constant" error In reply to
If you don't mind sending over FTP details etc, then I don't mind having a quick look for you. Otherwise, I guess its a case of waiting for a reply from GT :(

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] mod_perl community "Useless use of a constant" error In reply to
I sure can if GT dont get back in time.

I need to speak to the man about it though and get you an account set up. Also its dev/virtual server so its not normally setup. ow and need a static IP as its firewalled.
Quote Reply
Re: [catlovette] mod_perl community "Useless use of a constant" error In reply to
Ah, don't think I can be of much help to you then, as I'm not running on a static IP :( (dialup, at least for 15 more days).

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] mod_perl community "Useless use of a constant" error In reply to
Dial-up! That’s a bit medieval.

How do you cope? Wink
Quote Reply
Re: [catlovette] mod_perl community "Useless use of a constant" error In reply to
Quote:
Dial-up! That’s a bit medieval.

Yeah, tell me about it!

Quote:
How do you cope?

I generally find that smoking a lot of cigarettes, and taking regular breaks (to stop headaches) generally keeps my temper under wraps Tongue

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] mod_perl community "Useless use of a constant" error In reply to
This is just a guess. Does the directory im installing in have to be a normal ScriptAlias for cgi?

Then after install i enable the mod_perl for the directory?
Quote Reply
Re: [catlovette] mod_perl community "Useless use of a constant" error In reply to
Afraid I'm not sure. I try to stay as far away from mod_perl as possible when installing/developing, as it has a horrible habit of caching my scripts, and making debugging a PITA Frown

Sorry I can't be of more help.

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [catlovette] mod_perl community "Useless use of a constant" error In reply to
Try installing from shell - this removes any mod_perl related problems.
Quote Reply
Re: [afinlr] mod_perl community "Useless use of a constant" error In reply to
I thought about doing that. But wasnt sure it that would cause more errors!
Quote Reply
Re: [catlovette] mod_perl community "Useless use of a constant" error In reply to
ok. Just for anyone else who may have this problem.
I installed with CGI enabled for the install directory. Then enabled mod_perl for the applications and directory.
This worked fine.