hi. i m building a GUI based script in which the user is prompted for some input. when a button is pressed, a long time consuming command starts which freezes the GUI. in order to overcome this problem, i tried using fork but the script crashes with the following error msg:

I really don't have time to explain fork... but I know it can be a pain to work with. Especially when referencing child processes. Here's a copy of my script for pinging it creates fork process to ping... Been a while since I looked at the code. Hope it helps.

#!/usr/bin/perl

use Net::Ping; use Socket; use Term::ANSIColor; use Win32::Console::ANSI; use Cwd;

As far as I know there isn't a way to share variables between forked processes. I believe it will share variables all the way up until the process is forked. Then it re-runs the entire script in the fork, from start to finish. What you could do it create a "slush" file. That is being read and written by both child and parent.