[Koha-devel] error-log => bug/warning

Alan Millar am12 at bolis.com
Fri Jun 21 06:25:02 CEST 2002


On Fri, Jun 21, 2002 at 02:36:04PM +0200, paul POULAIN wrote:
> In the error log, there is a lot of the following warnings :
> 
> Use of uninitialized value in string ne at 
> /home/paul/koha.dev/koha/C4/Output.pm line 176, <KC> line 15.
> Use of uninitialized value in string eq at 
> /home/paul/koha.dev/koha/C4/Output.pm line 182, <KC> line 15.
> 
> How to solve it ? I think it's the array that's not defined. the problem 
> is in 1.2 and main.

I tracked down one or two of these and usually found that it is
in a subroutine that expects some input, but got passed an empty
parameter list.

The short answer is you can use the Perl "defined" test to check
the variable before operating on it.  I fixed one in the main
branch already.  I don't know if it is the best fix but I did it
like this:


diff -c -w -r1.9 -r1.10
*** Output.pm   15 May 2002 04:08:38 -0000      1.9
--- Output.pm   21 May 2002 06:15:41 -0000      1.10
***************
*** 137,142 ****
--- 137,143 ----
  
  sub endmenu {
    my ($type) = @_;
+   if ( ! defined $type ) { $type=''; }
    if ($type eq 'issue') {
      open (FILE,"$path/issues-bottom.inc") || die;
    } elsif ($type eq 'opac') {
---------------------


- Alan

----
Alan Millar     --==> am12 at bolis.com <==--




More information about the Koha-devel mailing list