Skip to main content.
home | support | download

Back to List Archive

SWISHE.pm and SwishOpen errors

From: Daniel E. Weber <d-weber(at)not-real.itg.uiuc.edu>
Date: Wed Aug 21 2002 - 23:14:18 GMT
During debugging of a script that uses SWISHE.pm, I encountered the 
following problem. The code:

>my $handle = SwishOpen( "indexfile" ) or die "CRUD!\n";

produces instead of "CRUD!":

>err: Could not open the index file 'avid.index': No such file or directory .

My original reading of the manpage, including the example right at the top, 
led me to believe that SwishOpen would return undef upon an error. 
Revisiting the manpage and reading a bit further, I get the impression that 
the line:

>Returns undefined on an error, but the only errors are typically fatal,
>so will most likely exit the running program.

means that SwishOpen itself will exit the program without a mechanism for 
capturing the error.

Is there any way around this? I'd like to be able to customize the output 
so people using the interface know who to contact, alternatives to the 
service, et cetera.

If there isn't an easy way around it, I suppose I can at least check for 
the existence of the file myself to avoid at least this particular error. I 
guess I'm concerned about the other errors that I haven't tested for yet.

Thanks for your time!
-Daniel




----------

]:o_ | Daniel E. Weber (d-weber@uiuc.edu) - Imaging Technology Group   | _o:{
  |O =| 4311 Beckman Institute, 405 N Mathews, Urbana, IL, 61801 MC-251 |= O|
  |_o=| 217-244-3191 (off) * 217-244-6219 (fax) * 217-244-3074 (lab)    |=o_|
   \  |               SUBMIT TO THE POWER OF KETCHUP                    |  /
Received on Wed Aug 21 23:17:57 2002