in reply to (in cleanup) Can't call method "close" on an undefined value at somePerlModule.pm line number.

Who told you that you need to use destructors in Perl? Sure, you might need them at some point but most of the time you do not need them because Perl does a great job of cleaning up after itself.

  • Comment on Re: (in cleanup) Can't call method "close" on an undefined value at somePerlModule.pm line number.

Replies are listed 'Best First'.
Re^2: (in cleanup) Can't call method "close" on an undefined value at somePerlModule.pm line number.
by thanos1983 (Parson) on Jan 30, 2015 at 22:35 UTC

    Hello Mr. Muskrat,

    Thank you for your input, it starts to make more sense. But as you said, how can I understand when is needed to use Destructor or not? Is there some way to do understand it or is it based on experience?

    Seeking for Perl wisdom...on the process of learning...not there...yet!

      It's definitely going to be easier when you have more experience. :)

      Basically it boils down to knowing how you have created the object and what you have stored in it.