in reply to Re: Re: Re: How to use variables from other package?
in thread How to use variables from other package?
I'm not sure I understand. Perl can indeed check variable names at compile time, even if they're fully qualified. Create a file called Foo.pm:
package Foo; use vars qw( $foo ); $foo = 1;
Use it within a test program like so:
#!/usr/bin/perl -w use strict; use Foo; print "$Foo::foo\n"; print "$Foo::fooo\n";
This gives me:
Name "Foo::fooo" used only once: possible typo at usefoo.pl line 7. 1 Use of uninitialized value in concatenation (.) or string at usefoo.pl + line 7.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Re: Re: How to use variables from other package?
by integral (Hermit) on Apr 27, 2003 at 20:01 UTC |