The gentoo has upgraded perl to perl-5.12 and immidiately one of my modules stopped to work. The error was somewhat weird, so after playing with deleting pieces of code I reduced everything to the following 2 files
try.pl
#!/usr/bin/perl use strict; use MyPackage; MyPackage::close_cnx();
MyPackage.pm
package MyPackage; use strict; use constant INIT => 4; sub close_cnx { my $self = shift; init_action($self); } sub init_action { my $self = shift; return if $self->{Needed} <= $self->{count}; callit($self->{ID}, INIT); } 1;
An attempt to execute "try.pl" results in the message
Undefined subroutine &main::Needed called. INIT failed--call queue aborted.
Enabling warnings clarifies, that the problem may be from the conflicting use with the INIT block. But if such use is so disastrous, why is it not a syntax error? Are there some reasons to have it only as warning?
In reply to Conflict with INIT block is not an error? by andal
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |