Dealing with exit in a Modulino
  Home FAQ Contact Sign in
comp.lang.perl.moderated only
 
Advanced search
POPULAR GROUPS

more...

 Up
Dealing with exit in a Modulino         

Group: comp.lang.perl.moderated · Group Profile
Author: Marc Girod
Date: Mar 26, 2008 09:33

Hello,

I am writing tests for a CPAN module, which contains a script.
I found it convenient to make this script a Modulino, so that
I could 'use' it from my test.pl (thus being sure I use the same
perl, the same context etc.)
Now, this script does call exit in different places, which is not
suitable for my purpose.
The solution I used so far strikes me as inelegant:

- pass a $noexit when calling from make test
- replace everywhere:
exit $rc
with
($noexit ? return $rc : exit $rc)

There is even a signal handler...

Marc
3 Comments
diggit! del.icio.us! reddit!