# Scenario 1, example of the problem: my $is_file_exists = 1; my $db_path = $ST_DB_PATH.$db_name; unless (-e $db_path) { print "The file doesn't exist\n"; $is_file_exists = 0; } #### # Scenario 2, example of workaround that solves the problem: my $is_file_exists = 1; my $db_path = $ST_DB_PATH.$db_name; # Adding cat command to solve the "-e" problem `cat $db_path > /dev/null`; unless (-e $db_path) { print "The file doesn't exist\n"; $is_file_exists = 0; }