Re: Include variables from external perl script



On Oct 30, 9:38 am, r...@xxxxxxxxxx (Ron Bergin) wrote:
On 10/30/07, howa <howac...@xxxxxxxxx> wrote:

Consider the example below...

Config.pl
======

#!/usr/bin/perl -w

my $value = "abc";
In addition to changing 'my' to our' in Config.pl, you'll also need to
add the 'our $value;' to Script.pl

Blatantly untrue. The OP was not using strict. 'our' is only
required to be able to refer to global variables without qualifying
them when strict 'vars' is in use. If there is no strict, 'our' is a
no-op.

Paul Lalli

.



Relevant Pages

  • Re: getting remote image sizes with image::size lwp
    ... messages, the clearly marked lines they refer to, and a description of what happens or doesn't when you ... use strict; ... use warnings; ... at the top of your script. ...
    (perl.beginners)
  • Re: Help with syntax
    ... I can't believe I posted a semicolon question to ... the newsgroup. ... refer to the exact line where the error is. ... I'm using strict here to help catch ...
    (comp.lang.perl.misc)
  • Re: putting an image link into the CSS
    ... element has to refer to a graphic providing information about the purpose ... evangelism: XHTML 1.0 Strict ...
    (comp.infosystems.www.authoring.stylesheets)
  • Re: HELP! "Method Missing" error message driving me insane.
    ... Why do I need to use strict? ... None of this throwing around global variables willy nilly is productive. ... you do not seem to know when your code is crap. ... Sinan Unur ...
    (comp.lang.perl.misc)
  • Re: Using Variables from Another Script
    ... that creates one global hash that contains all your values, ... package MyConfig; ... use strict; ... I tried putting the global variables in a hash in global_hash.pl as ...
    (comp.lang.perl.misc)