in reply to Getting "close() on unopened filehandle FH" from Log::Log4perl

G'day glasswalk3r,

I see two issues here:

  1. In run(), you have "__PACKAGE->gimme_logger()". That should probably be "__PACKAGE__->gimme_logger()". [You may be across this information already but, in case you're not: __PACKAGE__ is described in "Special Literals" under perldata - Scalar value constructors; and Log::Log4perl - Pitfalls with Categories describes a caveat when using __PACKAGE__.]
  2. gimme_logger(), run() and DEMOLISH() all have "my $self = shift;" but none of them use $self.

-- Ken

Replies are listed 'Best First'.
Re^2: Getting "close() on unopened filehandle FH" from Log::Log4perl
by glasswalk3r (Friar) on Aug 01, 2013 at 22:08 UTC

    Thanks Ken,

    I have already got the typo with __PACKAGE__, I'll update the node.

    Regarding the $self variable, gimme_logger() really does not need it, I'll update it as well. The other does use $self, but I haven't put all the code

    Alceu Rodrigues de Freitas Junior
    ---------------------------------
    "You have enemies? Good. That means you've stood up for something, sometime in your life." - Sir Winston Churchill