From: Nicholas Clark Date: Tue, 13 Oct 2009 14:35:15 +0000 (+0100) Subject: Opening dirhandle DIR also as a file needs no warnings 'deprecated'; X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=3963d30b5a2dc4d265ac265e8db15801366a507f;p=p5sagit%2Fp5-mst-13.2.git Opening dirhandle DIR also as a file needs no warnings 'deprecated'; --- diff --git a/t/op/stat.t b/t/op/stat.t index 007869e..5167655 100644 --- a/t/op/stat.t +++ b/t/op/stat.t @@ -495,8 +495,11 @@ SKIP: { ok(-d DIR, "-d on a dirhandle works"); # And now for the ambigious bareword case - ok(open(DIR, "TEST"), 'Can open "TEST" dir') - || diag "Can't open 'TEST': $!"; + { + no warnings 'deprecated'; + ok(open(DIR, "TEST"), 'Can open "TEST" dir') + || diag "Can't open 'TEST': $!"; + } my $size = (stat(DIR))[7]; ok(defined $size, "stat() on bareword works"); is($size, -s "TEST", "size returned by stat of bareword is for the file"); @@ -525,8 +528,11 @@ SKIP: { ok(-d -r *DIR{IO} , "chained -x's on *DIR{IO}"); # And now for the ambigious bareword case - ok(open(DIR, "TEST"), 'Can open "TEST" dir') - || diag "Can't open 'TEST': $!"; + { + no warnings 'deprecated'; + ok(open(DIR, "TEST"), 'Can open "TEST" dir') + || diag "Can't open 'TEST': $!"; + } my $size = (stat(*DIR{IO}))[7]; ok(defined $size, "stat() on *THINGY{IO} works"); is($size, -s "TEST",