horrendo has asked for the wisdom of the Perl Monks concerning the following question:
I've tried this on Perl 5.8.0 on RHEL 3, and 5.8.6 on Cygwin with the same result (although different line number in DynaLoader.pm).Subroutine UNIVERSAL::VERSION redefined at /usr/lib/perl5/5.8.0/i386-l +inux-thread-multi/DynaLoader.pm line 249. Subroutine UNIVERSAL::can redefined at /usr/lib/perl5/site_perl/5.8.0/ +Class/Std.pm line 506.
and here is the script :package TestBase; use strict; use warnings; use Class::Std; { my %prop1 : ATTR( init_arg => 'prop1' get => 'prop1' set => 'prop1 +' ); my %prop2 : ATTR( init_arg => 'prop2' get => 'prop2' set => 'prop2 +' ); 1; }
I know the warnings aren't fatal, but I would prefer they weren't there. I checked the code in Class::Std and just before the eval that generates the warning, there is a line#!/usr/bin/perl -W use strict; use warnings; use TestBase; my $b = TestBase->new( { prop1 => 'hello', prop2 => 'world' } ); print $b->_DUMP ; print 'b->prop1 = ' . $b->get_prop1 . "\n"; print 'b->prop2 = ' . $b->get_prop2 . "\n"; $b->set_prop1('horrendo'); $b->set_prop2('revolver'); print $b->_DUMP ;
I would have thought this would suppress the warning.no warnings 'redefine';
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Class::Std redefine warnings
by itub (Priest) on Aug 11, 2005 at 18:50 UTC | |
by horrendo (Sexton) on Aug 11, 2005 at 20:50 UTC |