summaryrefslogtreecommitdiff
path: root/demos/perl
diff options
context:
space:
mode:
authorKevin Ryde <user42@zip.com.au>2003-11-28 22:44:01 +0100
committerKevin Ryde <user42@zip.com.au>2003-11-28 22:44:01 +0100
commitc8f2c8b31324984f84dfee9dae86cb3e83ac87de (patch)
treea796908cc1657526355795ffacca1ef7e8888f66 /demos/perl
parent03af1ff841cb18c2da4c05d3ef8293f75c73a1f0 (diff)
downloadgmp-c8f2c8b31324984f84dfee9dae86cb3e83ac87de.tar.gz
* demos/perl/GMP/Mpf.pm (overload_string): Use $OFMT to avoid warnings
about $#.
Diffstat (limited to 'demos/perl')
-rw-r--r--demos/perl/GMP/Mpf.pm13
1 files changed, 4 insertions, 9 deletions
diff --git a/demos/perl/GMP/Mpf.pm b/demos/perl/GMP/Mpf.pm
index 76246ea33..308457bd5 100644
--- a/demos/perl/GMP/Mpf.pm
+++ b/demos/perl/GMP/Mpf.pm
@@ -1,6 +1,6 @@
# GMP mpf module.
-# Copyright 2001 Free Software Foundation, Inc.
+# Copyright 2001, 2003 Free Software Foundation, Inc.
#
# This file is part of the GNU MP Library.
#
@@ -73,17 +73,12 @@ sub import {
sub overload_string {
my $fmt;
- {
- # don't whinge about $# being deprecated
- local $^W = 0;
- $fmt = $#;
- }
- if (! defined $fmt) {
+ if (! defined $OFMT) {
$fmt = '%.Fg';
} else {
# protect against calling sprintf_internal with a bad format
- if ($# !~ /^(%%|[^%])*%[-+ .\d]*[eEfgG](%%|[^%])*$/) {
- die "GMP::Mpf: invalid \$# format: $#\n";
+ if ($OFMT !~ /^(%%|[^%])*%[-+ .\d]*[eEfgG](%%|[^%])*$/) {
+ die "GMP::Mpf: invalid \$# format: $OFMT\n";
}
$fmt = $OFMT;
$fmt =~ s/(.)$/F$1/;