You should almost always be able to assign a pid(name) to the process, and even assign the location for the pidfile, itself. This will give you the "handle" you need to control the process in most any way you choose. :)

Best wishes.

--Chris

UPDATE: from perlvar
$PROCESS_ID $PID $$ The process number of the Perl running this script. Though you can set + this variable, doing so is generally discouraged, although it can be + invaluable for some testing purposes. It will be reset automatically + across fork() calls. Note for Linux and Debian GNU/kFreeBSD users: Before Perl v5.16.0 perl + would emulate POSIX semantics on Linux systems using LinuxThreads, a + partial implementation of POSIX Threads that has since been supersed +ed by the Native POSIX Thread Library (NPTL). LinuxThreads is now obsolete on Linux, and caching getpid() like this +made embedding perl unnecessarily complex (since you'd have to manual +ly update the value of $$), so now $$ and getppid() will always retur +n the same values as the underlying C library. Debian GNU/kFreeBSD systems also used LinuxThreads up until and includ +ing the 6.0 release, but after that moved to FreeBSD thread semantics +, which are POSIX-like. To see if your system is affected by this discrepancy check if getconf + GNU_LIBPTHREAD_VERSION | grep -q NPTL returns a false value. NTPL th +reads preserve the POSIX semantics. Mnemonic: same as shells.
See also: How do I know my process id, from within perl script
Hey. I'm not completely useless. I can be used as a bad example.

In reply to Re^5: The proper way to execute echo aabbcc >> file in backround by taint
in thread The proper way to execute echo aabbcc >> file in backround by young_monk_love_perl

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.