|P is for Practical|
small text game with fork problemby Anonymous Monk
|on Sep 26, 2011 at 21:14 UTC||Need Help??|
Anonymous Monk has asked for the
wisdom of the Perl Monks concerning the following question:
I don't know why this "game" came to me but I had some time to waste and thought it'd be funny.
Basically have two scripts, 1.pl and 2.pl. Both are identical in nature except they both call each other. I begin the script by calling perl 1.pl.
The idea is the script counts, then passes that number to the other script and then it ++s it and counts, then passes it back and forth. Each one counts then passes. However you can type during it.
The problem is I can't get $cmd_cnt to add. Each time you type something and hit enter I want it to ++ so it displays the next @funny. This is the only part I can't get to work, each time I enter something it goes back to 0.
Can you help?