summaryrefslogtreecommitdiff
path: root/lib/Class/Struct.pm
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2000-11-29 17:01:41 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2000-11-29 17:01:41 +0000
commit22633ac4d822d56571390c6ca915a7e5a37ef483 (patch)
tree7a229098a02d887af8309fe151515ac7d0bd426e /lib/Class/Struct.pm
parentee28235b3274e2a0a6e2b8de32573633563eef75 (diff)
downloadperl-22633ac4d822d56571390c6ca915a7e5a37ef483.tar.gz
Make the Class::Struct import() wiser.
p4raw-id: //depot/perl@7926
Diffstat (limited to 'lib/Class/Struct.pm')
-rw-r--r--lib/Class/Struct.pm10
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;
}
}