in reply to How to do WildChars (*) on the command line for my script

Processing command line arguments is handled very well by Getopt::Long. The arguments processed by Getopts::Long are removed from @ARGV. Try changing your command line to expect the files to process as the last set of arguments. e.g.
myscript.pl -o output.txt -l log.txt [files to process]

Expanding command line wildcards is either done by the shell (UNIX) or by a module such as Win32::Autoglob for Windows. Failing either of these options, you can also use the glob operator to get an array of filenames.

This example uses Getopt::Long and Win32::Autoglob

#! /usr/bin/perl -w use strict; use Win32::Autoglob; use Getopt::Long; my $outputFile = ''; my $logFile = ''; my $result = GetOptions ("output=s" => \$outputFile, "logfile=s" => \$logFile); print "Output=$outputFile\n"; print "Log=$logFile\n"; $,=' '; print "Files to work with:",@ARGV;

Replies are listed 'Best First'.
Re: Re: How to do WildChars (*) on the command line for my script
by EchoAngel (Pilgrim) on May 28, 2004 at 18:47 UTC
    thanks for all your help guys! =)