Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: Parsing the command line: manual or module?

by Velaki (Chaplain)
on Aug 17, 2006 at 17:48 UTC ( [id://567982]=note: print w/replies, xml ) Need Help??


in reply to Parsing the command line: manual or module?

In a word: Consistency.

By adhering to a standard method of parsing the command line, you ensure that future programs will conform to accepted standards, that best practices are followed, and that existing code is maintainable by any and all resources.

Additionally, using a module such as Getopt::Long is advantageous in that it enforces the behavior of various command line options, e.g.  -v -f filename, which is notoriously time-consuming to code well by hand. Also, it keeps the user from having to use -h for a program, when --history could be understood more easily.

In all fairness, TMTOWTDI, but why not use a well-tested, code-proven module, like Getopt::Long? I see only advantages; no disadvantages with it -- other than maybe a small learning curve.

Pax vobiscum,
-v.

"Perl. There is no substitute."

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://567982]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (9)
As of 2024-04-18 17:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found