This will read the _closed_ directory handle, without an error, if invoked as % perl test_file (where test_file) contains the above code.#!/usr/bin/perl -w use strict; opendir (TOPDIR,"$ENV{HOME}") or die "Thus shall ye likewise perish: $!"; close TOPDIR; while ($_=readdir(TOPDIR)){ print "$_\n"; }
But, I just discovered that if I chmod 0755 test_file, the code fails without a warning when invoked directly. So, I'm more confused than ever. What is happening here?
In reply to read closed directory handle? by mkmcconn
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |