diff options
author | Yasushi Nakajima <sey@jkc.co.jp> | 2000-08-29 01:38:08 +0900 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2000-08-28 15:42:47 +0000 |
commit | 476757f70a9a13196bdf0a87d8e24804db1e95bc (patch) | |
tree | 4529f0e796b5d989806aa88f7d43e9662e6c2086 /lib/Math | |
parent | c40596a0a824dd4f6b8c3eb24e1df05d38f66f30 (diff) | |
download | perl-476757f70a9a13196bdf0a87d8e24804db1e95bc.tar.gz |
display_format used as a class method without arguments was broken,
reported in
Subject: Math::Complex->display_format() sets style to 'Math::Complex'
Message-Id: <200008280738.QAA00215@san.p.kyoto.jkc.co.jp>
p4raw-id: //depot/perl@6857
Diffstat (limited to 'lib/Math')
-rw-r--r-- | lib/Math/Complex.pm | 27 |
1 files changed, 10 insertions, 17 deletions
diff --git a/lib/Math/Complex.pm b/lib/Math/Complex.pm index ece2aad06c..e7a071ab7f 100644 --- a/lib/Math/Complex.pm +++ b/lib/Math/Complex.pm @@ -7,10 +7,10 @@ package Math::Complex; -$VERSION = "1.30"; - our($VERSION, @ISA, @EXPORT, %EXPORT_TAGS, $Inf); +$VERSION = 1.31; + BEGIN { unless ($^O eq 'unicosmk') { my $e = $!; @@ -1253,23 +1253,15 @@ sub display_format { my %obj = %{$self->{display_format}}; @display_format{keys %obj} = values %obj; } - if (@_ == 1) { - $display_format{style} = shift; - } else { - my %new = @_; - @display_format{keys %new} = values %new; - } - } else { # Called as a class method - if (@_ = 1) { - $display_format{style} = $self; - } else { - my %new = @_; - @display_format{keys %new} = values %new; - } - undef $self; + } + if (@_ == 1) { + $display_format{style} = shift; + } else { + my %new = @_; + @display_format{keys %new} = values %new; } - if (defined $self) { + if (ref $self) { # Called as an object method $self->{display_format} = { %display_format }; return wantarray ? @@ -1277,6 +1269,7 @@ sub display_format { $self->{display_format}->{style}; } + # Called as a class method %DISPLAY_FORMAT = %display_format; return wantarray ? |