koha-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Alan Millar
Subject: Re: [Koha-devel] error-log => bug/warning
Date: Fri Jun 21 06:25:02 2002
User-agent: Mutt/1.2.5i

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     --==> address@hidden <==--



reply via email to

[Prev in Thread] Current Thread [Next in Thread]