open(LOK, ">>/non-existing/file") || my_subroutine($!); sub my_subroutine { print "Oh no! Error: ".shift; }