didess has asked for the wisdom of the Perl Monks concerning the following question:
The "caller" :#!/usr/bin/perl # ----------------- package tryOur; our $ExecDir = "/usr/local/bin"; # 1;
The result on the screen:#!/usr/bin/perl # ---------------- use tryOur; printf ("U line %d: ExecDir=%s\n",__LINE__,$ExecDir); printf ("U line %d: ExecDir=%s\n", __LINE__,$tryOur::ExecDir);
Why don't i get the value of $ExecDir when not prefixing it with the package name ? I'm sure to do something wrong, but what ? Thanks in advance. DidierU line 6: ExecDir= U line 7: ExecDir=/usr/local/bin
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: I can't see "our" variables from outside the package
by ikegami (Patriarch) on Aug 23, 2008 at 11:33 UTC | |
|
Re: I can't see "our" variables from outside the package
by moritz (Cardinal) on Aug 23, 2008 at 07:38 UTC | |
|
Re: I can't see "our" variables from outside the package
by GrandFather (Saint) on Aug 23, 2008 at 07:54 UTC | |
|
Re: I can't see "our" variables from outside the package
by Anonymous Monk on Aug 23, 2008 at 07:57 UTC |