sub write2logfile {   open(F, ">> file.log");   print F $!;   close(F);   0; } if(open(...) or write2logfile(...)) {   # tu dies und das }