in reply to Variables from modules

You need to add package test; at the top of test.pm

Dave.

Replies are listed 'Best First'.
Re^2: Variables from modules
by Anonymous Monk on Sep 16, 2004 at 14:14 UTC
    That didn't do it either. I'm still getting the same error. test.pm now looks like this:
    package vars; use strict; our $foo = "test"; 1;
      er.
      package test;
      was thinking of something else while typing.
        Try renaming your package. There's a standard module called Test, and you're probably picking that one up.
        It works for me.
        $ cat test.pm use strict; package test; our $foo = "test"; 1; $ cat p #!/usr/bin/perl -w use strict; use lib "."; use test; print $test::foo ."\n"; $ ./p test $

        Dave.