in reply to More on Processing Command Line Arguments

Two comments:

1) Move your "initialize variables" section above your call to GetOptions so the lexical variables will exist before you use them.

2) pod2usage() will exit your program, so you don't need the "print manual" in the else.

  • Comment on Re: More on Processing Command Line Arguments

Replies are listed 'Best First'.
Re: Re: More on Processing Command Line Arguments
by Ninthwave (Chaplain) on Oct 31, 2003 at 16:09 UTC

    Sorry that was a cut and paste error when I first copied it I chopped off the initialisation of the variables, when I pasted them pack in I did it in the wrong place. I have found I flaw in the logic also while testing, and am focussing on getting it so that only one of the four options is specified for add record, edit record, list records, view record. the line

    if (($Add_Record xor $Edit_Record) xor ($List_Records xor $View_Record +))
    is not the logic I want. In that case if three values are true the statement is true.