in reply to Check whether a file exists

I would suggest what NetWallah suggested previously
if (-e 'database.db') { #database exists }