[EMAIL PROTECTED] wrote: > > 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.
It may be as well to update to ActivePerl v5.8, but check what version you have with perl -v It's also a good idea to check the status of the closure close FILE or die "Unable to close file: $!"; HTH, Rob -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/