in reply to Re: Re: global variables
in thread global variables

no, it will work allright if you just change the   my $var = "blah";   to   our $var = "blah";   in   inc.conf.

Cheers, Sören

Replies are listed 'Best First'.
Re: Re: Re: Re: global variables
by rsiedl (Friar) on May 31, 2004 at 14:54 UTC
    so like this??
    #!/usr/bin/perl use strict; use warnings; use "inc.conf"; our $var; print $var , "\n"; exit;
    And the contents of inc.conf...
    #!/usr/bin/perl use strict; use warnings; our $var = "blah"; 1;
    Because I still get a syntax error. Forgive me if I am a bit dense :)
      no, as davidj said, ignore his post. change 'my' to 'our' and you're done. require is just fine.
      for more info read Fletch's post and see perlfunc for require and use.

      -   use "inc.conf";
      +   require "inc.conf";

      Your first try wasn't that bad.