in reply to main script invoked twice

There are three obvious cases you need to look out for.

First: it could be that the program is running the script inside itself (look carefully in the Our::UI::CommandLine->ui_run() routine and see if it could be running itself again. (for example by an exec call)

Second: The process numbers of Solaris processes "wrap round", that is once you have enough processes running the next allocated process number starts at the bottom again (ommitting numbers that are active at the time of course).

Third: The value of the $$ variable could be being modified by the "use Our::UI::CommandLine;" line. For example it could be set in the BEGIN block.

Replies are listed 'Best First'.
Re: Re: main script invoked twice
by Fletch (Bishop) on Mar 29, 2004 at 02:43 UTC
    Third: The value of the $$ variable could be being modified by the "use Our::UI::CommandLine;" line. For example it could be set in the BEGIN block.

    Erm, that's not exactly possible.

    $ perl -le 'print $$; $$ = 1234; print $$' 11142 Modification of a read-only value attempted at -e line 1.

    Underneath $$ is a call to getpid(2) and hence the value can't be modified directly.