#!/usr/bin/perl use strict; use warnings; # change to -w for < 5.6 (i think) my $file = "$ENV{'HOME'}/.poof"; if(stat($file)) { print "we were able to stat $file\n"; } else { die "$!\n"; # or warn() ... }