Expotential numbers (like 1e1) aren't converted correctly when used with
the "x" operator. The number is truncated at the "e". This did work
with Perl 4.x:
Example:
$number = "1e1"; #imagine this as chop($number = <STDIN>)
$string = "a";
print "$string" x $number, "\n";
In Perl 4.x, it prints "aaaaaaaaaa", In Perl5.0, it prints only "a".
However, the following two do work in both Perl4.x and Perl5.0:
$number = 1e1; #Works, but can't enter it from <STDIN>
$string = "a";
print "$string" x $number, "\n";
$number = "1e1";
$string = "a";
$number = $number + 0; #1e1 is converted first
print "$string" x $number, "\n";
--
David Weintraub _/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
System Configuration Management _/ _/
Dow Jones/Telerate - NSG _/ I AM THE GREAT AND POWERFUL OZ* _/
dhw@telerate.com _/ _/
_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
*Pay no attention to the man behind the curtains.
the "x" operator. The number is truncated at the "e". This did work
with Perl 4.x:
Example:
$number = "1e1"; #imagine this as chop($number = <STDIN>)
$string = "a";
print "$string" x $number, "\n";
In Perl 4.x, it prints "aaaaaaaaaa", In Perl5.0, it prints only "a".
However, the following two do work in both Perl4.x and Perl5.0:
$number = 1e1; #Works, but can't enter it from <STDIN>
$string = "a";
print "$string" x $number, "\n";
$number = "1e1";
$string = "a";
$number = $number + 0; #1e1 is converted first
print "$string" x $number, "\n";
--
David Weintraub _/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
System Configuration Management _/ _/
Dow Jones/Telerate - NSG _/ I AM THE GREAT AND POWERFUL OZ* _/
dhw@telerate.com _/ _/
_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
*Pay no attention to the man behind the curtains.