in reply to Sharing Global variables between scripts

If CommonFunctions is using Exporter to do its export (or even if it has a custom import routine), then it will export into the package that you did the use from.

In Dispatcher.cgi.pl your package statement preceeds the use statements so the functions wind up in package DispatchParser.

In TAZ.pl you reversed that order so the functions wound up in package main, and then you're looking for them in package DispatchParser.

  • Comment on Re: Sharing Global variables between scripts

Replies are listed 'Best First'.
Re: Re: Sharing Global variables between scripts
by TASdvlper (Monk) on Apr 16, 2004 at 22:28 UTC
    I'm a little confused, so how do I resolve the problem (if I can) ? Thanks in advance. I don't normally use global variables so I'm a little new to this.
      You move the package declaration to the top of your script. That will remove the error message that you are getting.

      Note that this will not (as pointed out by gjb) magically cause data which exists in one process to be visible in another.

      Also note that global variables in general should be used with caution. You want to limit how many you have, and you want to get maximal value from each one.