You could redirect STDERR for the time you make calls into that module.
package Foo; sub foo { warn "blorf!" } 1;
#!/usr/bin/perl use Foo; use strict; use warnings; sub call (&); call { Foo::foo(); }; if ($@) { warn "foo reported: '$@'\n"; } ## subs # sub call (&) { my $coderef = shift; my $message; open my $fh , '>&', \*STDERR; close STDERR; open STDERR, '>', \$message; $coderef->(); open STDERR, ">&", $fh; $@ = $message; } __END__ foo reported: 'blorf! at Foo.pm line 3. '
That way all you have to do is wrap the places where you call into Sybase::CTlib into a block and dispatch that to the call() function.
In reply to Re: How can I catch a Server message displayed in Sybase::CTlib module
by shmem
in thread How can I catch a Server message displayed in Sybase::CTlib module
by goutam_monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |