File Locked after Close?

[email protected]
Newsgroups perl.beginners
Organization http://groups.google.com
Message-ID <056fd24f-839f-4416-8f04-e92f14da879f@x41g2000hsb.googlegroups.com>
Hi,

I'm doing the following:

open FILE, '<file.dat' || die '...';
# Do something with FILE
close FILE;
system 'command file.dat'; # This fails

The last line fails even though I closed FILE.  However, if I break
out the last line into a separate script that is run later, it runs
fine.  Therefore, it looks like there is some kind of lock that is
left on FILE even though I closed it.

If I open another file with the same handle, then everything works.
For instance:

open FILE, '<file.dat' || die '...';
# Do something with FILE
close FILE;
open FILE, 'another.dat' || die '...';
system 'command file.dat'; # This works

Unfortunately this is too awkard, so I would like to avoid it.  Any
ideas on what may be happening or a more elegant way to ensure the
problem (lock?) doesn't occur?  If it helps, I'm using an older build
of ActiveState Perl (sorry, don't recall the version) on a WinXP
system, running in a DOS shell.


Thanks!
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.