Your shell globbing will kick in calling your program from the command line. It should Just Work as you have it. If it doesn't, check your use of the diamond operator, <>
Within a program, you can use the glob function to get the same effect.
After Compline, Zaxo
| [reply] |
You haven't mentioned what you've already tried but I assume you know that @ARGV can be your friend. Very simple example:
#!/usr/bin/perl -w
use strict;
for (@ARGV) {
# do stuff
}
--
vek
-- | [reply] [d/l] [select] |
The c:\> in Prayag's post gives us a good indication that they're doing this in a Windows (or DOS) environment, which (by default) doesn't expand asterisks, etc. (aka "shell globbing").
Instead, you need to all such expansion yourself, with something like...
my @files;
push @files, glob foreach @ARGV;
... which breaks as soon as you want to open a file containing an asterisk or other expansion character.
Anyhoo, for further discussion, see the recent portable globbing behavior for command-line tool.
--k.
| [reply] [d/l] |
FWIW, I haven't found a way of creating a filename with an embedded wildcard char yet.
This may be possible under *nix, but I wonder what would stop the shell from trying to expand it everytime someone tried to use it? Showing my ignorance of *nix stuff again.
| [reply] |
Kanji++ You're right of course, I must admit that in my haste I did not notice the C:\>.
Cheers.
--
vek
--
| [reply] |