in reply to Re^5: globally seen variable
in thread globally seen vairable

I did it, but it does not pass a value into $ERROR_FILE in the package.
I defined our $ERROR_FILE in main and assigned a variable to it, not a constant. Is it possible?

Replies are listed 'Best First'.
Re^7: globally seen variable
by BrowserUk (Patriarch) on Sep 29, 2010 at 14:32 UTC

    junk.pl:

    #! perl -slw use strict; use Junk; our $ERROR_FILE = 'fred'; Junk::showIt();

    Junk.pm:

    package main; our $ERROR_FILE; package Junk; use strict; use warnings; sub showIt { print $ERROR_FILE; } 1;
    C:\test>junk.pl fred

    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.