my $s = q{};eval { $s = iwpt_load_dcr($file, $mode) || die "Unable to load DCR '$file' ($mode)";};if ($@){die $@;}
I'm not surprised to see it put the error to stdout, but it is a little surprising that it doesn't catch the error. All I can figure is that they don't actually raise an error code. I'm starting to have vague memories of having run into some similar problems with error trapping in PTs. Try compiling to ocode and see what the resulting perl looks like. It may also be interesting to see if it will catch the exception properly at the command line but not when run in the context of TeamSite:Tparser.
Interestingly, the PTparser object contains a member called "eval_error", so it may be possible to manipulate that from within your PT. If you can, doing so would definitely not be a supported approach, though.
Adam, since when is dieing without any error handling a good thing?
Thanks for your help Rob and Fish. I'm just going to use eval to check if the file can be opened first before calling iw load dcr.eval{ open (DCR, $pathToFile) || die "couldn't open the file!";};$badDCR="bad" if $@;