in reply to Issues trying to pass variable to SOAP::Lite

That's because use SOAP::Lite takes place at compile time which is before the assignment to $soap_url is made. You can get around this by setting $soap_url in a BEGIN block:
BEGIN { our $soap_url = "..." }; use SOAP::Lite ..., proxy => $soap_url, ...;
Note that you can't declare $soap_url using my.

Replies are listed 'Best First'.
Re^2: Issues trying to pass variable to SOAP::Lite
by ayapejian (Novice) on Apr 29, 2008 at 18:36 UTC
    Thanks for the info ... that makes sense, however I'm running this in a persistent perl environment, don't know if the begin block will work in my case, I'll try. Any other ideas while I'm giving it a shot? Thanks Again.
Re^2: Issues trying to pass variable to SOAP::Lite
by ayapejian (Novice) on Apr 29, 2008 at 20:57 UTC
    So the begin block worked as mentioned, however it did break my script when placed in a persistent environment, since the begin block is only activated once in this environment. So ... anyone else have some ideas? If autodispatch is broken, is there a way around this?
      perldoc -f use
      perldoc -f import
        I'm guessing 'use' and 'import' operate the same as BEGIN in a persistent environment, they only get ran once per compile, is this correct? The problem being that BEGIN works great the first time the app is compiled, but with speedycgi(PerPerl) the program is only compiled once for multiple runs, so I cannot redefine that variable after the first run.
        I'm guessing 'use' and 'import' operate the same as BEGIN in a persistent environment, they only get ran once per compile, is this correct? The problem being that BEGIN works great the first time the app is compiled, but with speedycgi(PerPerl) the program is only compiled once for multiple runs, so I cannot redefine that variable after the first run.