![]() |
|
Welcome to the Monastery | |
PerlMonks |
oo code don't want to die !by iza (Monk) |
on Nov 28, 2001 at 22:38 UTC ( [id://128136]=perlquestion: print w/replies, xml ) | Need Help?? |
iza has asked for the wisdom of the Perl Monks concerning the following question:
hi :)
sorry if the question sounds stupid, but i've read the die() doc, perlman::perlvar, and the oo tutorial, and haven't found nothing sooo, what i'd like to do is to catch an interruption signal, and stop the program (doesn't look so hard ;]) - the point is that, as the program creates & calls some objects, it seems i have to wait for these objects to return before killing them (seems logical so far) what i don't understand, is that those objects are created & used in a foreach loop, and my code seems to kill only the CURRENT object - then the loop goes on and creates the next object, while i'd like it to stop maybe it's as simple as "your SIG{INT} isn't in the right place" or maybe is that i totally misunderstood perl's behaviour (hopefully not) ... here is the code (part of)
i let the file part in the foreach loop just to show there was something done after the call to "run" so what happens is that the current object actually gets killed, i see the message from die, but the loop continues : the file is created, and then started again with a new object if anyone knew where i fail, or how i could do to actually kill the program (exit the foreach loop, don't create the file, don't create nor call anymore object), i'd be really happy :)) thanx for having read ;]
Back to
Seekers of Perl Wisdom
|
|