Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Is is possible to maintain variables between perl scripts besides regular text? For example I have created a COM object using win32::ole, and I'd rather pass some type of pointer between webpages rather than recreating the COM object each time a page loads. Is this in any way a possiblility?

Replies are listed 'Best First'.
Re: Variable Passing
by rob_au (Abbot) on Jan 17, 2002 at 04:55 UTC
    I must say that this question opens a veritable can of worms as there are many frameworks that exist for the maintenance of state that allow for not only the persistence of scalar variables, but also complex data structures. The latter part of which in itself can be an issue unto itself - For example for serialising or representing complex data structures, there is Storable, Data::Dumper and Data::Denter.

    As for session and state management, there is Apache::Session (and the easy front-end to it, CGI::Session), Apache::SessionX, CGI::MxScreen and Bundle::OpenInteract.

    Good luck.

     

    perl -e 's&&rob@cowsnet.com.au&&&split/[@.]/&&s&.com.&_&&&print'

Re: Variable Passing
by metadoktor (Hermit) on Jan 17, 2002 at 05:12 UTC
    You could split your problem into a server script and a client script. Let your server script create and maintain the COM object while your client scripts could communicate with it via message queues (see the msgctl, msgget, msgrcv and msgsnd functions).

    metadoktor

    "The doktor is in."