program flow after interrupt

Discussion in 'Perl Misc' started by Palaniappan, Jun 3, 2004.

  1. Palaniappan

    Palaniappan Guest

    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;
    }
     
    Palaniappan, Jun 3, 2004
    #1
    1. Advertising

  2. Palaniappan wrote:
    > 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.

    --
    Josef Möllers (Pinguinpfleger bei FSC)
    If failure had no penalty success would not be a prize
    -- T. Pratchett
     
    Josef Moellers, Jun 3, 2004
    #2
    1. Advertising

  3. Palaniappan

    Uri Guttman Guest

    >>>>> "JM" == Josef Moellers <> writes:

    JM> Palaniappan wrote:
    >> 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.


    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

    --
    Uri Guttman ------ -------- http://www.stemsystems.com
    --Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
    Search or Offer Perl Jobs ---------------------------- http://jobs.perl.org
     
    Uri Guttman, Jun 3, 2004
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. prabhu
    Replies:
    1
    Views:
    543
    Ralf Hildebrandt
    Feb 25, 2004
  2. =?ISO-8859-1?Q?philip_st=F6ver?=

    interrupt the after method?

    =?ISO-8859-1?Q?philip_st=F6ver?=, Nov 28, 2003, in forum: Python
    Replies:
    1
    Views:
    248
    =?ISO-8859-1?Q?philip_st=F6ver?=
    Nov 28, 2003
  3. utab
    Replies:
    18
    Views:
    1,713
    Diego Martins
    Apr 27, 2006
  4. Jack Dowson
    Replies:
    0
    Views:
    479
    Jack Dowson
    May 7, 2007
  5. dutche
    Replies:
    13
    Views:
    550
    Kenny McCormack
    May 4, 2010
Loading...

Share This Page