summaryrefslogtreecommitdiff
path: root/demos/perl
diff options
context:
space:
mode:
authorKevin Ryde <user42@zip.com.au>2003-12-10 01:09:30 +0100
committerKevin Ryde <user42@zip.com.au>2003-12-10 01:09:30 +0100
commite1ceeecaccf1edff85818710df7561782267b54f (patch)
tree1a4440c9cee7d7601320b00760703981e01cdb39 /demos/perl
parentb8d0242ee6f2b8a874f1dacfcfcf9a643420622b (diff)
downloadgmp-e1ceeecaccf1edff85818710df7561782267b54f.tar.gz
More of:
* demos/perl/GMP/Mpf.pm (overload_string): Corrections to $# usage. Need $^W on perl 5.005.
Diffstat (limited to 'demos/perl')
-rw-r--r--demos/perl/GMP/Mpf.pm5
1 files changed, 2 insertions, 3 deletions
diff --git a/demos/perl/GMP/Mpf.pm b/demos/perl/GMP/Mpf.pm
index efa0a0a7b..258ee43e3 100644
--- a/demos/perl/GMP/Mpf.pm
+++ b/demos/perl/GMP/Mpf.pm
@@ -73,17 +73,16 @@ sub import {
sub overload_string {
my $fmt;
- no warnings;
+ BEGIN { $^W = 0; }
if (defined ($#)) {
$fmt = $#;
- use warnings;
+ BEGIN { $^W = 1; }
# protect against calling sprintf_internal with a bad format
if ($fmt !~ /^((%%|[^%])*%[-+ .\d]*)([eEfgG](%%|[^%])*)$/) {
die "GMP::Mpf: invalid \$# format: $#\n";
}
$fmt = $1 . 'F' . $3;
} else {
- use warnings;
$fmt = '%.Fg';
}
GMP::sprintf_internal ($fmt, $_[0]);