#NOTE THE CODE: local($nmbr_items) = @some_array; #DOESNT WORK SO ALWAYS DECLARE IT FIRST. #### while (read directory) { add to temp array; } examine array to set up loop vars for next loop while (loopvars tell us were still in the loop) { generate return array } #### my @returnvalue; while(read directory) { skip some bad entries ('.' , '..', and non-dirs) add value to @returnvalue } return @returnvalue;