in reply to Re: Undefined Value as Symbol reference
in thread Undefined Value as Symbol reference

$config::logfile is in reference to the config.pm which is located in the config folder and within the config.pm is a variable called $logfile = "output.txt";

package config; $logfile = "output.txt"; 1;

Of course there are other variables in the config.pm that the user can specify to his/her applications. This works fine under WinXP not Win7 for some reason.

Replies are listed 'Best First'.
Re^3: Undefined Value as Symbol reference
by runrig (Abbot) on Mar 07, 2014 at 18:39 UTC
    When I say 'make sure...' I mean something like:
    print "LOGFILE: $config::logfile\n";
    And then you can say, "yes, it's what it's supposed to be" (or not). I don't care what it's supposed to be in reference to...just what it actually is. And did I mention "check if your open's are successful" ?

      The output from that snippet of code produced the following in the terminal: LOGFILE: output.txt

        How about changing:
        my $tee = new IO::Tee(\*STDOUT, new IO::File(">>$config::logfile"));
        to (update: fixed typo per reply):
        my $fh = IO::File->new(">>$config::logfile") or die "Failed to open $c +onfig::logfile: $!"; my $tee = IO::Tee->new(\*STDOUT, $fh) or die "Failed to create tee: $! +";