John Peacock <jpeacock@rowman.com> writes: >I've been a bad boy and not been testing recent releases of version.pm >on earlier Perl's. I've fixed the compatibility problems with one >exception: I'm using 'no warnings' to suppress the "redefined" noise >when I replace UNIVERSAL::VERSION with a version-object aware sub. This >is fine for 5.6.x, but I'm not sure the best way to get around it for 5.005. > >I've got a "compatibility" module for warnings.pm which I could include >with the 5.005 pure Perl version.pm module, but all it does is some >horrific fiddling with the global $SIG{__WARN__}. I don't feel all that >bad using it during testing, but I don't want to install it. I could >strip out the 'no warnings' line and just leave the couple of warnings >during the test, but it would also show up anytime you used version.pm too. > >So the question is: should I install a "compatibility" warnings.pm on >5.005 to mostly DTRT? I can't figure out how to fake > > no warnings qw(redefine); > >using an inline package (i.e. I can get it loaded but I cannot convince >'use' that it _is_ already loaded). use looks for %INC entry to see if it is already loaded so : -------------------------------------------------- BEGIN { package Foo; $INC{'Foo.pm'} = __FILE__; } use Foo; ... --------------------------------------------------- > >JohnThread Previous | Thread Next