@list = bsd_glob('~gnat', GLOB_ERR); die("Unable to glob: $!\n") if GLOB_ERROR; # Keep only references to existing files. @list = grep -f, @list; die("glob returned no existing results\n") if not @list; #### # XXX WRONG $rv = print $fh (...); if ($!) { die("Unable to write to file: $!\n") } # Ok $rv = print $fh (...); if ($rv) { die("Unable to write to file: $!\n") }