From: drieux <[EMAIL PROTECTED]>
> On Tuesday, June 11, 2002, at 07:12 , Jenda Krynicky wrote:
> > From: Bob Showalter <[EMAIL PROTECTED]>
> >> The parsing of the command line and preparation of the argument
> >> list is a function of the shell or command interpreter. Perl just
> >> takes the argument list given to it via the execve() call.
> >
> > This is not true under Windows.
> > There the program doesn't get a list of parameters, but a "command
> > line" and has to parse it itself. Which is usualy done by calling
> > some function from C runtime libraries.
>
>
> this 'concerns' me - You are asserting that the windows
> command line here passes all the stuff typed at the command line
> prompt without any form of 'globbing' at all???
Almost. The redirections and similar stuff is processed by the
"shell" before starting your program, but the rest is passed to it as
is.
And the C runtime function doesn't glob the parameters. It only
splits them.
> hence
>
> myPerlCode *.xml
>
> would not find all of the *.xml files in that directory????
> merely pass in the actual token "*.xml" and it is up to moi
> to wanderate my way through them....
Exactly.
Perl 5.005 (or maybe 5.003?) used to do the globing for you, but it
doesn't do it now.
This means that if you run
perl -e "print join(qq{\n}, @ARGV)" *.txt
under windows (!!! If using cmd.exe as your shell! Unix shells or
even cygwin are totally different beasts !!!) you should get just
*.txt
While this may sometimes lead to a more efficient code (why to create
a huge list of files if all you need is to process them one by one?
readdir + some regexp will be better.) more often it's not what you'd
want.
Therefore Gurusamy Sarathy created his Wild.pm and I my G.pm (
http://Jenda.Krynicky.cz/#G ) that takes care of this and globs the
parameters.
Jenda
=========== [EMAIL PROTECTED] == http://Jenda.Krynicky.cz ==========
There is a reason for living. There must be. I've seen it somewhere.
It's just that in the mess on my table ... and in my brain
I can't find it.
--- me
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]