This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
More pseudohashery.
authorJarkko Hietaniemi <jhi@iki.fi>
Thu, 28 Nov 2002 21:50:05 +0000 (21:50 +0000)
committerJarkko Hietaniemi <jhi@iki.fi>
Thu, 28 Nov 2002 21:50:05 +0000 (21:50 +0000)
p4raw-id: //depot/maint-5.8/perl@18211

lib/fields.t

index ce57f86..1f4cf05 100755 (executable)
@@ -70,6 +70,7 @@ package main;
 sub fstr {
    my $h = shift;
    my @tmp;
+   no warnings 'deprecated';
    for my $k (sort {$h->{$a} <=> $h->{$b}} keys %$h) {
        my $v = $h->{$k};
         push(@tmp, "$k:$v");
@@ -133,9 +134,12 @@ $ph = fields::phash([qw/a b c/], [1, 2, 3]);
 print "not " unless fstr($ph) eq 'a:1,b:2,c:3';
 print "ok ", ++$testno, "\n";
 
-$ph = fields::phash([qw/a b c/], [1]);
-print "not " if exists $ph->{b} or exists $ph->{c} or !exists $ph->{a};
-print "ok ", ++$testno, "\n";
+{
+    no warnings 'deprecated';
+    $ph = fields::phash([qw/a b c/], [1]);
+    print "not " if exists $ph->{b} or exists $ph->{c} or !exists $ph->{a};
+    print "ok ", ++$testno, "\n";
+}
 
 eval '$ph = fields::phash("odd")';
 print "not " unless $@ && $@ =~ /^Odd number of/;