Subject: | IO::LockedFile object is not properly cheked after creation |
IO::LockedFile checked to be open after creation:
$self->{FH} = new IO::LockedFile({ lock => 0 }, ">>".$self->{FILE_PATH});
unless ($self->{FH}->opened) {
...
}
but if file doesn't exist, new IO::LockedFile returns undef, so it shows not informative error message:
Can't call method "opened" on an undefined value
I think, it should be checked like this:
unless ($self->{FH} and $self->{FH}->opened) {
...
}
Thank you.