open(LOK, ">>C:\\Perl\\RTEOlock\\check\\RTEOlock.log") || this_is_sub() ; #### unless ( open(LOK, ">>C:\\Perl\\RTEOlock\\check\\RTEOlock.log") ) { # do what ever we can not open the file ... }