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;

In reply to Re: How to do WildChars (*) on the command line for my script by inman
in thread How to do WildChars (*) on the command line for my script by EchoAngel

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.