program flow after interrupt

P

Palaniappan

Hi all,
i am using perl script to read few
named pipes and process it.
sometimes the program hangs if there
is no input in pipes. i want to skip
the pipes if there is no input.

so i am using alarm interrupt to break
the flow. but i want to know how to
restart the script again from interrupt ?

if i use 'goto' statement from interrupt
(jumping out of the function)
won't it increase the size of PC stack ?

(see attached code)

-palam

-----------------------------------------

LINE1_LABEL:
$SIG{'ALRM'}= &alarm_interrupt;
<declarations>;
<perl code>;
<perl code>;
<perl code>;

sub alarm_interrupt()
{
goto LINE1_LABEL;
}
 
J

Josef Moellers

Palaniappan said:
Hi all,
i am using perl script to read few
named pipes and process it.
sometimes the program hangs if there
is no input in pipes. i want to skip
the pipes if there is no input.

perldoc -f select

You need to scroll down a page to find
select RBITS,WBITS,EBITS,TIMEOUT

Better than disturbing the flow of energy ... errr ... program.
 
U

Uri Guttman

JM> perldoc -f select

JM> You need to scroll down a page to find
JM> select RBITS,WBITS,EBITS,TIMEOUT

bah, no one but those who get into that low level stuff should directly
call select. you can use IO::Select, Event.pm and others things which
have a better api.

uri
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top