http://www.perlmonks.org?node_id=1011450


in reply to stat : error handling

Try something like this:
use warnings; use strict; my @stats = stat 'foo'; if (@stats) { print "OK\n"; } else { print "Error\n"; }

Also, use <blockquote> instead of quote.