in reply to Check for another running instance of the same program
I would use File::HomeDir with something else, maybe File::Lockfile ( lock $my_data/appname/.lockfile )