Gossamer Forum
Home : Products : Gossamer Forum : Discussion :

Uninitialized value in pattern match in Convert.pm

Quote Reply
Uninitialized value in pattern match in Convert.pm
I just got an email from the Cron Daemon on the machine running my forum, titled Cron "<fdsadmin@vanguard> /var/home/fdsadmin/forums.software4nonprofits.com/cgi-bin/fdsforum/admin/cron/subscribe.pl --send", with the following content:

Use of uninitialized value in pattern match (m//) at /home/fdsadmin/forums.software4nonprofits.com/cgi-bin/fdsforum/admin/GForum/Convert.pm line 40.

That message repeats about 10 times.

What does that mean? What do I do about that?

I'm using version 1.2.3.

Thanks.

Dan Cooperstock
info@Software4NonProfits.com
Quote Reply
Re: [DanCooperstock] Uninitialized value in pattern match in Convert.pm In reply to
Hi,

Does it run ok other than that? I've seen errors like that before, and normally they are ok to just ignore :)

Hope that helps.

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] Uninitialized value in pattern match in Convert.pm In reply to
I'm not aware of other problems, and no users are reporting problems, but of course they might just have a problem and not report it.

This is like the 2nd time this has happened in a few weeks. My forum gets very little traffic, though.
Dan Cooperstock
info@Software4NonProfits.com
Quote Reply
Re: [DanCooperstock] Uninitialized value in pattern match in Convert.pm In reply to
Hi,

Mmm..are they only occurring in SSH/Telnet scripts (or cron daemons) ? If so, then that should be ok. You do get some, erm, "interesting" messages popping up sometimes in cronjobs/ssh processes =)

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: [DanCooperstock] Uninitialized value in pattern match in Convert.pm In reply to
It's a warning. It may not be too important but it means that there's a variable being used in that regex that has not been initialized. There are various reasons why this might happen.

eg...

Code:
#!/usr/bin/perl -w

my $variable;
if ($variable =~ /test/) {
print "something";
}

If you were to use:

Code:
my $variable = "testing";

...the warning would go away.
Quote Reply
Re: [Wychwood] Uninitialized value in pattern match in Convert.pm In reply to
See, the thing is, I haven't modified that code. It's part of the Gossamer Forum code. That's why I'm posting the question here!

The code in Convert.pm where this occurs is as follows:

sub convert_signature { GT::Plugins->dispatch("$CFG->{admin_root_path}/Plugins/GForum", 'convert_signature', \&_plg_convert_signature, @_) }
sub _plg_convert_signature {
my ($text, $sig) = @_;
$$text =~ s/\[\s*(\.*)\s*\Q$CFG->{markup_signature_tag}\E\s*\]/
if ($USER and not $USER->{user_view_signatures}) {
'';
}

Line 40 is the 3rd-last line that starts "if ($USER".

Can someone tell me what might be wrong with it? Thanks.
Dan Cooperstock
info@Software4NonProfits.com
Quote Reply
Re: [DanCooperstock] Uninitialized value in pattern match in Convert.pm In reply to
I assume the error is because $CFG->{markup_signature_tag} isn't defined. I would guess it's not to do with the use of $$text, as $text is a scalar reference and so if it was undefined you'd get an "Undefined value used as a scalar reference" error.

Edit: Is that definitely the right line?....the error states pattern match m// and not substitution s///

Last edited by:

Wychwood: Jun 22, 2007, 5:23 PM