in reply to Finding the PID of zenity in a perl script.

You have to stop using & in your exec, since that creates yet another pid.

exec ('/usr/bin/zenity', '--display=:0.0', '--info', '--title=Reminder +', '--text=' . $reminder) or die ...
I suspect that your $pid++ is assuming that nothing else gets launched between your fork/exec and the shell's parsing and fork/exec of zenity.

That all said: formatting! And try Proc::Fork or something to simplify your child/parent handling.

Replies are listed 'Best First'.
Re^2: Finding the PID of zenity in a perl script.
by HappyTimeHarry (Initiate) on Nov 11, 2010 at 00:20 UTC
    Perfect! Thank you very much. :)