Features & Development

bug? "Use of uninitialized value $result[0] in print at /opt/webwork/webwork2/lib/WeBWorK/Template.pm line 154."

bug? "Use of uninitialized value $result[0] in print at /opt/webwork/webwork2/lib/WeBWorK/Template.pm line 154."

by Christian Seberino -
Number of replies: 1
(I don't know which forum this belongs on.  No one commented yet on the main forum so I'm trying here to hope to get some help with this mystery.)

I just set up a Webwork server from the Amazon EC2 public image
and every problem seems to have this warning at the bottom...

"Use of uninitialized value $result[0] in print at /opt/webwork/webwork2/lib/WeBWorK/Template.pm line 154."

....

Here is a snippet of that file below.  Line 154 is the "print @result;".

.....

                               pop @ifstack; 
                        } elsif ($ifstack[-1]) { 
                                if ($cg->can($function)) { 
                                        my @result = $cg->$function({@args}); 
                                        if (@result) { 
                                                print @result; 
                                        } else { 
                                                warn "Template escape $function\
 returned an empty list."; 
                                        } 
                                } 
 

cs
In reply to Christian Seberino

Re: bug? "Use of uninitialized value $result[0] in print at /opt/webwork/webwork2/lib/WeBWorK/Template.pm line 154."

by Michael Gage -
It's hard to tell from this error message. Some value is undefined and the part of the code that puts it in the template is complaining. Unfortunately it gives no clue as to which value is undefined Probably some configuration error. I don’t think it has any direct relation with being on EC2