in reply to Getopt::Long

At the risk of being branded a heretic I have never been much of a fan of the Getopt modules. Why not just parse @ARGV yourself to generate exactly the behaviour you want?

cheers

tachyon

s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print

Replies are listed 'Best First'.
Re:x2 Getopt::Long
by grinder (Bishop) on Dec 16, 2002 at 10:54 UTC

    Um... no, sorry. It's just not worth the effort.

    I'll agree with the fact that in some respect the Getopt modules leave a bit to be desired.

    I'm in two minds about it. On one hand, every time I need to use them, I need to consult the documentation. I don't know whether this is because they are not intuitive enough to use, or whether I don't use them enough to memorise all the minor details. This is especially true of Getopt::Long. Things like switch bundling don't work "out of the box." You have to flick a switch (so to speak) in order to get what I perceive to be the natural behaviour.

    On the other hand, they do what they are designed to do. They deal with a chore that I can't be (or don't want to be) bothered with. I'm perfectly willing to bend a bit to the way they do things, rather than spend too much time getting things just right, if that frees up my time to concentrate on the core of the program. I don't think anyone should be parsing the command line by themselves these days... it's just too costly in programmer time for such a minor return on investment.


    print@_{sort keys %_},$/if%_=split//,'= & *a?b:e\f/h^h!j+n,o@o;r$s-t%t#u'