in reply to Loading all .txt files within current directory
As an example, this:
prints the file names matching the "m*.txt" pattern under Linux, Unix or Cygwin. But it doesn't work under Windows:$ perl -E 'say $_ for @ARGV' m*.txt mail_cmc.txt modules.txt mots.txt ...
The difference is that the Unix or Linux shell will expand "m*.txt" into a list of files matching the pattern and pass the list to the Perl script, whereas Windows is too lazy to do that and just passes the pattern as you have entered.C:\Users\Laurent>perl -E "say $_ for @ARGV" t*.* t*.*
In the latter case (i.e. with Windows, you need glob or something equivalent to expand this pattern into a list of files.
perl -E "my @a = glob(shift); say $_ for @a" t*.* test_hash.pl test_parl10_1.pl test_perl10.pl test_perl11.pl ...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Loading all .txt files within current directory
by Discipulus (Canon) on Feb 01, 2016 at 11:26 UTC |