It seems like most Perl scripts, along with most utilities that come with Unix-like operating systems, rely on command line switches to control them. If they don't recognize any of the flags you used, they just instruct you to run it again with -h or --help specified.
Maybe it's because I mainly use Windows, but whenever I write a small command line script, even if it's just for my own use, I always have it prompt for input if none is specified. For example, these two commands would accomplish the same thing:
> perl script.pl -f filename.txt
> perl script.pl
Which file would you like to use?
filename.txt
I can only recall having seen one program that did this, which was a Perl script that walked you through setting up users for mySQL.
Is there a good reason for not doing it my way? It seems like that would make the program much more accessible to users who can't remember all those flags. Is it just a case of these programs traditionally being used by advanced Unix users or called by other programs?
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.