in reply to Re: Getopt::Long Validation
in thread Getopt::Long Validation

On the unless statement should that be xor. Because or is validated left to right but if the left expression is true it stops. So if both were true it would still process?

So this code could accept:

foo.pl -f ip.txt -i 127.0.0.1
I am testing the code now but just questioning if my understanding of the logic is correct. I like to process it in my mind before on the screen.

Update just ran it and it needs to xor to limit it to one of the two input methods.

Replies are listed 'Best First'.
3Re: Getopt::Long Validation
by jeffa (Bishop) on Oct 21, 2003 at 15:18 UTC
    Yep, you sure do. I wrote my code such that the file trumps the IP argument. I personally prefer this, after all - why should i care if the user specifies both? I'll just pick one and go - but the xor does do a better job of making those who don't like to RTFM do so. ;)

    jeffa

    L-LL-L--L-LL-L--L-LL-L--
    -R--R-RR-R--R-RR-R--R-RR
    B--B--B--B--B--B--B--B--
    H---H---H---H---H---H---
    (the triplet paradiddle with high-hat)
    
      I agree I just know the users that will have to use this and I know it will be an issue I would get email about for awhile. But thank you for the main logic it helped greatly.