in reply to How to do WildChars (*) on the command line for my script
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 |