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.
print @array[2]
And it will output the third file/directory if you know what I mean.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Put "ls" in array
by jethro (Monsignor) on Apr 26, 2012 at 09:36 UTC | |
by bimleshsharma (Beadle) on Apr 27, 2012 at 09:24 UTC | |
Re: Put "ls" in array
by pelagic (Priest) on Apr 26, 2012 at 09:30 UTC | |
Re: Put "ls" in array
by serf (Chaplain) on Apr 26, 2012 at 09:57 UTC | |
by JavaFan (Canon) on Apr 26, 2012 at 10:09 UTC | |
Re: Put "ls" in array
by hperange (Beadle) on Apr 26, 2012 at 09:44 UTC | |
Re: Put "ls" in array
by DrHyde (Prior) on Apr 26, 2012 at 10:06 UTC | |
Re: Put "ls" in array
by xiaoyafeng (Deacon) on Apr 27, 2012 at 15:13 UTC |
Back to
Seekers of Perl Wisdom