@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;