Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
This is perhaprs a very simple question. However I would like to automatically list the files in a directory an store them in array. So I use globbing, which I do as follows:
@files=</path/to/dir/*.type>
That works out well. The problem I have is that I what to give it variable (which is taken is as a parameter by the perl script. This however doesn't appear to work. I am doing the following
$path_to_dir = $ARGV[0];
@files=<$path_to_dir>
Any advice on how this could work..?
THANKS!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Globbing uncertainty
by Tanktalus (Canon) on Nov 11, 2010 at 18:14 UTC | |
by ikegami (Patriarch) on Nov 11, 2010 at 18:53 UTC | |
|
Re: Globbing uncertainty
by jethro (Monsignor) on Nov 11, 2010 at 18:01 UTC | |
|
Re: Globbing uncertainty
by Marshall (Canon) on Nov 11, 2010 at 19:36 UTC | |
by Tanktalus (Canon) on Nov 11, 2010 at 20:29 UTC | |
by Marshall (Canon) on Nov 11, 2010 at 20:58 UTC | |
by Anonymous Monk on Nov 11, 2010 at 23:48 UTC | |
|
Re: Globbing uncertainty
by Anonymous Monk on Nov 11, 2010 at 23:59 UTC |