in reply to How to goto new sub if file empty?

Something else you could try is a file test before attempting to open the file:
if (-s $file) { open(FILE, $file) || die "open: $file - $!\n"; # etc } else { warn "There are currently no links :(\n"; # or similar msg exit(); }
Take a peek at this for a list of file test operators.

-- vek --