I have installed Bugzilla 3.0 on Windows Server 2003 Service pack 1.
It was working fine in terms of functionality, but getting the message like

"Use of uninitialized value in substitution (s///) at (eval 44) line 44. [Thu Apr 19 11:31:55 2007] index.cgi: Use of uninitialized value in substitution (s///) at (eval 44) line 44."
in index.cgi.................
so i was trying to remove this.
I was just looking on my codes and i ran checksetup.pl
and after tht i m getting message
" All parameters are displayed below, per section. If you cannot find one from here, then the parameter does not exist.
Parameter Section"

when i saw the source code i got this message in \bugzilla-3.0rc1\index.html.tmpl
the code is

Template::Document->new({
METADATA => {
'modtime' => '1129195104',
'name' => 'index.html.tmpl',
},
BLOCK => sub {
my $context = shift || die "template sub called without context\n";
my $stash   = $context->stash;
my $output  = '';
my $error;


eval { BLOCK: {
$output .=  "\n";
$output .=  "\n\n<p>\n  All parameters are displayed below, per section.\n  If you cannot find one from here, then the parameter does not exist.\n</p>\n\n<div align=\"center\">\n  <table>\n    <tr>\n      <th>Parameter</th>\n      <th>Section</th>\n    </tr>";
#line 47 "template\en\default\index.html.tmpl"

But i m not getting what i had done wrong?
Can anybody have any idea?

Thanks in advance......

Dani AI

Generated

Short diagnosis and actionable steps.

That warning is Perl telling you a substitution operator ran against an undefined scalar — in a Bugzilla install that usually comes from a template variable missing from the Template Toolkit “stash” (the template engine compiles .tmpl files to Perl code and the generated code does the substitutions). , the important thing is not to edit the generated Template::Document file; fix either the template (.tmpl) or the code that populates the template variables.

How to find the exact spot

  • Turn warnings into a stack trace so you see where the undefined value originates. Add the following (temporarily) at the top of the CGI or the module that runs templates:

    use Carp;
    $SIG{__WARN__} = sub { Carp::confess(@_) };

    Then reproduce the problem; the backtrace will show the template/data line that produced the undefined value. Alternatively, run the CGI from the command line to get easier output.

Fixes you can apply

  • Template-side: guard the template variables with a default filter so the template never receives undefined values, for example:

    [% some_var | default('') %]

    or test with an IF block before doing string operations.

  • Perl-side: ensure variables are defined before applying s///. For modern Perl:

    $val //= '';     # Perl 5.10+
    $val =~ s/foo/bar/;

    For older Perl:

    $val = '' unless defined $val;
    $val =~ s/foo/bar/;

Operational tips and cautions

  • Do not silence warnings globally; that masks real bugs. Clear any template cache (so templates are recompiled) or restart the web server after changing templates. If running checksetup.pl changed behavior, re-run it only after correcting the missing parameter or template so the generated pages are clean. If more help is needed, post the small stack trace produced by the Carp approach and which template variable the trace points to.

makes no sense to me. Did you get this warning fixed?

Use of uninitialized value in substitution (s///) at (eval 44) line 44. [Thu Apr 19 11:31:55 2007] index.cgi: Use of uninitialized value in substitution (s///) at (eval 44) line 44."
in index.cgi

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.