in reply to Script Arguments and Wildcard Expansion under Windows NT

Your problem is that Unix expands wildcards before passing them to the program. Windows doesn't do this, prefering to let the program carry out it's own wildcard expansion.

You could get round it by adding another loop and using the glob operator.

foreach my $glob (@ARGV) { foreach my $file (<$glob>) { print("converting $file..."); open(FILE, "<$file"); my @lines = <FILE>; close(FILE);

Update: Abigail is right. I should have said "The default Windows shell doesn't do this".

--
<http://www.dave.org.uk>

Perl Training in the UK <http://www.iterative-software.com>

Replies are listed 'Best First'.
Re: Script Arguments and Wildcard Expansion under Windows NT
by Abigail (Deacon) on Jun 28, 2001 at 19:53 UTC
    Actually, it isn't a Unix vs NT thing. Wildcard expansion is done by the shell. Typical Unix shells, like sh, csh, ksh, bash, tcsh and zsh all do wildcard expansion. Several of those shells have been ported to the Windows environment. They should do wildcard expansion there as well.

    -- Abigail

Re: Re: Script Arguments and Wildcard Expansion under Windows NT
by mvaline (Friar) on Jun 28, 2001 at 21:58 UTC
    Excellent, thank you very much! You solved my problem and I learned about "globbing" for the first time -- another step on the road to sainthood.