http://www.perlmonks.org?node_id=967278

PatricF has asked for the wisdom of the Perl Monks concerning the following question:

Hi, I'm totally new to Perl and I'm making a script and need some help. I'm on Linux and I want to put the output of "ls" into an array. How do I do this? I need to be able to do something like this:
print @array[2]
And it will output the third file/directory if you know what I mean.