From: Peter Dintelmann Date: Wed, 24 Oct 2007 12:31:20 +0000 (+0200) Subject: warning from ext/Hash/Util/FieldHash/t/02_function.t X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=adfdc6a8eae049d641e732f3b68e2443d86b1aef;p=p5sagit%2Fp5-mst-13.2.git warning from ext/Hash/Util/FieldHash/t/02_function.t From: "Dintelmann, Peter" Message-ID: <3852726AFA94DE4F87E616F13F416A5FB66DE3@naimucu1.ffz00k.rootdom.net> p4raw-id: //depot/perl@32185 --- diff --git a/ext/Hash/Util/FieldHash/t/02_function.t b/ext/Hash/Util/FieldHash/t/02_function.t index 6365289..738209c 100644 --- a/ext/Hash/Util/FieldHash/t/02_function.t +++ b/ext/Hash/Util/FieldHash/t/02_function.t @@ -122,7 +122,7 @@ BEGIN { $n_tests += 5 } $f{ $key} = $val; is( $f{ $key}, $val, "plain key set in field"); my ( $id) = keys %f; - my $refaddr = hex +($key =~ /\(0x([[:xdigit:]]+)\)$/)[ 0]; + my $refaddr = refaddr($key); is $id, $refaddr, "key is refaddr"; bless $key; is( $f{ $key}, $val, "access through blessed"); @@ -314,6 +314,9 @@ BEGIN { plan tests => $n_tests } ####################################################################### sub refaddr { + # silence possible warnings from hex() on 64bit systems + no warnings 'portable'; + my $ref = shift; hex +($ref =~ /\(0x([[:xdigit:]]+)\)$/)[ 0]; }