in reply to Re: Development version of a script?
in thread Development version of a script?

I must be missing something simple, or else poorly explained my problem.

When I use any of the methods you guys have explained, I get many compilations error about explicit package names -- so perl is not seeing the file I am trying to include with those variables declared, or else they are out of scope? This was from the require perldoc -- I know it is mentioning the reverse case of what I am doing, but perhaps still relevant

The file is included via the do-FILE mechanism, which is essentially just a variety of eval with the caveat that lexical variables in the invoking script will be invisible to the included code.

Thanks for the tip about including my variables in an object -- it's a little over my head at my current perl level but I will put it on the list of things to check out

Here is the most basic reference to my code so you can see two of my trials of your suggestions

#require ::usr::local::bin::ebook_distributor_DEV::ebooksend_config; eval "cat /usr/local/bin/ebook_distributor_DEV/ebooksend_config";

Replies are listed 'Best First'.
Re^3: Development version of a script?
by ELISHEVA (Prior) on Feb 07, 2011 at 23:56 UTC

    No you aren't missing anything - my bad. The eval cat option should be using backticks, not double quotes, e.g. eval `cat myfile.pl`

    My apologies.

    If that doesn't help then perhaps you could show a reduced version of your whole set up using just 1 or two variables. Even with the backticks, to get this to work you must take care with how you declare your variables. You will need to declare your variables in the calling script. If you declare them as "my", your config file should merely set variables and not declare them (no my). Alternatively you can declare your variables in both the calling and config script if you use our.

      I was being too dependent and not thinking about the code you were giving me to run -- should have caught your meaning and put in the backticks...

      Now I am understanding you -- I was trying to completely remove the variables from the main script, but I see what you mean about needing them declared in the main script and then just setting them in the "config" file. I haven't tested but I get it now -- thanks!