Subject: | Math::Complex has no copy constructor |
Math::Complex has no copy constructor and thus problems appear when copy
or original is modified by "mutator" operation.
Found in this perlbug report:
http://rt.perl.org/rt3/Ticket/Display.html?id=61142
Attached file is seriously simplified version of example in rt.perl.org
and can be used as a test.
--
Alexandr Ciornii, http://chorny.net
Subject: | copybug.pl |
#!/usr/bin/perl
use strict;
use warnings;
use Math::Complex;
my $q = Math::Complex->make(5, 0);
$q->display_format('cartesian');
my $qn = $q;
print "q=qn=$qn\n";
$q += 1;
#$q = $q + 1;
print "q=$q\n";
print "qn=$qn\n";