diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2000-11-29 17:01:41 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2000-11-29 17:01:41 +0000 |
commit | 22633ac4d822d56571390c6ca915a7e5a37ef483 (patch) | |
tree | 7a229098a02d887af8309fe151515ac7d0bd426e /lib/Class | |
parent | ee28235b3274e2a0a6e2b8de32573633563eef75 (diff) | |
download | perl-22633ac4d822d56571390c6ca915a7e5a37ef483.tar.gz |
Make the Class::Struct import() wiser.
p4raw-id: //depot/perl@7926
Diffstat (limited to 'lib/Class')
-rw-r--r-- | lib/Class/Struct.pm | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/Class/Struct.pm b/lib/Class/Struct.pm index 14d28fa4ac..185a8ff142 100644 --- a/lib/Class/Struct.pm +++ b/lib/Class/Struct.pm @@ -54,10 +54,14 @@ sub printem { sub import { my $self = shift; - if ( @_ % 2 == 0 ) { - &struct; - } else { + if ( @_ == 0 ) { $self->export_to_level( 1, $self, @EXPORT ); + } elsif ( @_ == 1 ) { + # This is admittedly a little bit silly: + # do we ever export anything else than 'struct'...? + $self->export_to_level( 1, $self, @_ ); + } else { + &struct; } } |