Skip Menu |

This queue is for tickets about the Devel-REPL CPAN distribution.

Report information
The Basics
Id: 82385
Status: open
Worked: 1 hour (60 min)
Priority: 0/
Queue: Devel-REPL

People
Owner: Nobody in particular
Requestors: tommy [...] cpan.org
Cc: gortan [...] cpan.org
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: file locking in externally loaded modules not working?
I wanted to test the following sequence using File::Util, which automatically locks files for you. If you put the same code into a single Perl script, the file locking works as expected. In a Devel::REPL session, it seems as if the file locking performed in File::Util doesn't work at all. Is this to be expected? For example, this code would fail in a Perl script, but does not fail in a Devel::REPL session. use strict; use warnings; use File::Util; my $f = File::Util->new(); my $fn = '/tmp/foo'; my $fh = File::Util->open_handle( file => $fn, mode => 'write' ); # all OK so far, until the next line which SHOULD cause a fatal error: my $fh2 = File::Util->open_handle( file => $fn, mode => 'write' ); # ^^^ the above should fail because $fn is already opened and locked ^^^
On Thu Jan 03 14:20:35 2013, TOMMY wrote: Show quoted text
> I wanted to test the following sequence using File::Util, which > automatically locks files for you. If you put the same code into a > single Perl script, the file locking works as expected. In a > Devel::REPL session, it seems as if the file locking performed in > File::Util doesn't work at all. Is this to be expected?
I tried to reproduce your issue, but to no avail: when running your test code (I have to call $f->open_handle instead of File::Util->open_handle), and specify a non-existing file, I get: Can't get a lock on the file: ( /tmp/prackasdf ) OS error if any: ( No such file or directory ) No difference if using Devel::REPL or not. Also, when specifying an existing file, the second call does not fail, no matter whether using Devel::REPL or not. Using my Gentoo Linux notebook with Linux 3.10.17 and Perl 5.16.3. Can you still reproduce the issue? Are you able to recreate it in a unittest?