I have an issue with a long running perl script, which timesout oracle connection.
So I got a requirement to resolve this issue by querying an emplty table at regular intervals to keep the cconnection alive.
So I want to do it in 3 steps inside a script.
1)need to call a method to query a table at regular intervals . how can I do this? using some infinite loop? also how can i exit from it by calling another method to kill it .
$obj->keep_connection_alive() { this method will query a blank table at regular intervals }

2)At the same time,in parallel with keep_connection_alive(), I need to call another method to load my files. This is the function that takes long time and creates timeout issues
$obj->load_my_file()
3)after loading the files,i need to kill the keep_connection_alive()
$obj->kill_connection()
Can I use some threads? Actually i need a multiprocesssing program that run keep_connection_alive() and load_my_file() in parallel and exit out from keep_connection_alive() when I am done with oad_my_file()
I am new to perl..Any help will be greatly appriciated..Thanks

In reply to multiprocessing in perl by shijumic

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.