in reply to opendir, readir into @array in one line?

without using backticks, you could try :
# bad @array = `ls $dir`; # better @array = glob("$dir/*"); # i usually use what you already had opendir(DIR,"$dir"); @array = readdir(DIR); closedir(DIR);

remeber the immortal word's of Socrates who said, "I drank what ?"