[Koha] use CGI::Carp to catch all perl errors [was: koha on debian etch 4.0]

Rick Welykochy rick at praxis.com.au
Wed Oct 31 13:15:31 NZDT 2007


Grant Johnson wrote:

> Did you ever have the issue of addbiblio.pl breaking and prompting your 
> browser to "save the file"?

Nope.


> I'm thinking is has something to do with the config of my 090 and 050 
> fields in the Koha config and the records I'm importing.
> Does this make any sense?

The error you mention above has occurred many times. It is not for the
reason you mention. It is much more basic than that.

When a Perl script dies before the HTTP header has been output, the
browser does not know that the content type is HTML ... so it attempts
to download the script itself and save it to disk (!)

When this happens, you of course want to see what the error is.

The following always works for me:

1. find the file causing trouble, e.g. addbiblio.pl in your case

2. add the following line after the "use CGI" line:

    use CGI::Carp qw(fatalsToBrowser);

    Now, when any error occurs it will be displayed in your browser.

Try the above and let the list know what error you have.
We can then help you.



cheers
rickw



-- 
_________________________________
Rick Welykochy || Praxis Services

When will governments realise that we do not want to live in economies,
we want to live in societies.
      -- Les Twentyman


More information about the Koha mailing list