in reply to Getting files matching pattern (i.e. *.html)

Users are directed to input a line such as "replacer -i *.html" to tell the program what base of files to start with. However, when I use getopts() to grab the *.html, it only gives me the first item.

This is because your shell interpolates. Try this one to see what happens:

perl -MData::Dumper -e'print Dumper(\@ARGV)' *
It is not done by Perl (might be on non-unices, I don't know about that), as you can see when you use echo(1):
echo *

- Yes, I reinvent wheels.
- Spam: Visit eurotraQ.

Replies are listed 'Best First'.
Re: Re: Getting files matching pattern (i.e. *.html)
by particle (Vicar) on May 13, 2002 at 12:31 UTC
    as a point of reference, for those who might not be able to test on various platforms... solaris shell interpolates, as does cygwin. windows does not. expect difficulties in porting if you use code like this.

    ~Particle *accelerates*