in reply to to get the un-forseen errors

Can't call method "Cells" on an undefined value at Perl_XYZ.pl line XX. My question here is that: where is that error message stored
Technically, this question can't be answered without seeing all the code which is used here (i.e. including the modules you use for accessing your worksheet), but in this case, we can be nearly sure that the text of the template for this message is stored inside the Perl runtime system.

Just wondering why you are concerned about this....

-- 
Ronald Fischer <ynnor@mm.st>

Replies are listed 'Best First'.
Re^2: to get the un-forseen errors
by godsown (Novice) on Feb 18, 2010 at 02:53 UTC
    I am looking for a way to capture the last thrown error in case the perl script aborts due to some error, coz I have to capture and return that error to QTP from where my perl script was invoked.

    That error line was just an example. I am handling the errors almost every where, but I just need a way to be sure, if an error that I have not handled occurs, at least I have the right error text being returned.

    Thanks,
    J
      I am looking for a way to capture the last thrown error in case the perl script aborts due to some error

      If the error is printed by a die statement, you can of course catch the exception using eval (and the message will be stored in $@). In the example you gave, this will likely work (unless some of the intervening functions in the call stack do some nasty countermeasures, of course). If the error is just printed without throwing an exception, there is no way to handle it, unless you are willing to modify the source code which causes the error.

      -- 
      Ronald Fischer <ynnor@mm.st>