Perl Monk, Perl Meditation | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Perhaps because if switches could occur after the start of the filename list, how could you tell whether "-f" is a filename or a switch?
Bear in mind that "-f" is a perfectly fine filename, since filenames (at least in unix) can contain any byte that isn't "\0" or "/". By having the restriction "all switches before any filename list", you can ensure that once you stop looking at switches (including having processed the "--" standard switch), everything that remains, no matter how whacky looking, is intended to be a filename. I think that's rather sane. -- Randal L. Schwartz, Perl hacker
In reply to Re: Why is it good practice for a cli script to take switch args before file list?
by merlyn
|
|