cmac has asked for the wisdom of the Perl Monks concerning the following question:

In the routines that follow the MODULE statement in an .xs file, can one write    or carp("whatever") after a call to a C routine before the MODULE statement, that returns a 1 to indicate success? The routines in question return the boolean to the Perl caller even though this is "not Perl-like" according to perlxs.

Are the restrictions on where a carp or croak call can be written, like after certain of the uppercase keywords? In particular, how would one add such a carp or croak call to a routine that currently has no such keywords at all, like
int test_ok(arg) SV *arg
The intent is to ensure that there's some record of a problem if the caller doesn't use the returned boolean. In particular, if the caller happens to be running under Apache2 and mod_perl2 (e.g. if it's me using my own module), I would like the message to go into the error_log file. Like "undefined value in concatenation" which for me seems to be the commonest error in error_log.

Thanks for being there,
cmac
www.animalhead.com