[PLEASE don't top-post; it makes it hard to follow the conversation]

On Sep 9, Manish Sapariya said:

On 09/09/2005 05:56 PM, Chris Devers wrote:

On Fri, 9 Sep 2005, Manish Sapariya wrote:

Shouldn't following snippet throw error message when
it is called without any parameter?

Because this didn't have an error. If you want it to quit, force it to quit.

    die "No output specified" unless defined $output;

Oh, my understanding is that when I specify

"output=s"
its a mandatory parameter and if not specified on command line,
GetOptions should return error.

Am i missing something?

Yes. What the documentation means is that the ARGUMENT to the parameter is mandatory, not the parameter itself.

  myprog --output

will cause an error, but

  myprog

and

  myprog --output=file

will not.


--
Jeff "japhy" Pinyan        %  How can we ever be the sold short or
RPI Acacia Brother #734    %  the cheated, we who for every service
http://www.perlmonks.org/  %  have long ago been overpaid?
http://princeton.pm.org/   %    -- Meister Eckhart

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to