in reply to Directory Listing to array

Did you open DIR with an opendir and not just an open? The department of brevity department suggests:
!/^\./ and push @standir, "$_\n" while ($_ = readdir(DIR)) # or @standir = grep { !/^\./ } readdir(DIR); # doesn't append \n