Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

making part of my program die

Status
Not open for further replies.

eve25

Programmer
Feb 9, 2004
32
US
Hi there,

I have this master script calling a few subroutines that are organized in different modules. For now I am using 'use' to get those subroutines loaded in my master script.
something like (really simplified):
####
#master.pl
####
use Mod1 qw(sub1);
use Mod2 qw(sub2);
...
foreach my $stuff(@bunchOfStuff)
{
$output1=&sub1(@inputArgs1);
$output2=&sub2(@inputArgs2);
}
####
My problem is that sometimes I want a subroutine to die but I don't want my master script to die with it...
I have been searching this forum and it seems that using PIPES to call my subroutines would solve my problem.
Since it would be an intensive work to modify everything from my module/subroutine structure to PIPES I'd like to make sure this is THE way to do it.

Any suggestions would be highly appreciated!
Thanks a lot!
Cheers,
Eve
 
You might use a alarm if the problem is that the sub routine takes too long. You could set a maximim time limit and maybe call "return" to get out of the sub routine early when if the alaram is triggered.


------------------------------------------
- Kevin, perl coder unexceptional! [wiggle]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top