in reply to trying to decide best data structure for problem at hand.

You've got some problems in the code which may be tripping you up. The loop
{ local $/ = 'undef'; foreach $line (<AWKSH>) { (@glob) = glob("/home/passwd.*"); } }
Looks like it has several problems. If you're using this code and are stucck, fixing the items above may get you moving again, along with the advice given by others on data structures.