This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Remove some 5.002 and 5.003 compatibility code from Class::Struct.
authorNicholas Clark <nick@ccl4.org>
Mon, 18 Jun 2012 15:36:47 +0000 (17:36 +0200)
committerNicholas Clark <nick@ccl4.org>
Mon, 18 Jun 2012 19:47:18 +0000 (21:47 +0200)
lib/Class/Struct.pm

index 9ae3ff9..ecb6231 100644 (file)
@@ -16,9 +16,6 @@ require Exporter;
 
 $VERSION = '0.64';
 
-## Tested on 5.002 and 5.003 without class membership tests:
-my $CHECK_CLASS_MEMBERSHIP = ($] >= 5.003_95);
-
 my $print = 0;
 sub printem {
     if (@_) { $print = shift }
@@ -220,9 +217,7 @@ sub struct {
                 $sel = "->{\$i}";
             }
             elsif( defined $classes{$name} ){
-                if ( $CHECK_CLASS_MEMBERSHIP ) {
-                    $out .= "    croak '$name argument is wrong class' if \@_ && ! UNIVERSAL::isa(\$_[0], '$classes{$name}');\n";
-                }
+                $out .= "    croak '$name argument is wrong class' if \@_ && ! UNIVERSAL::isa(\$_[0], '$classes{$name}');\n";
             }
             $out .= "    croak 'Too many args to $name' if \@_ > 1;\n";
             $out .= "    \@_ ? ($pre\$r->$elem$sel = shift$pst) : $pre\$r->$elem$sel$pst;\n";