in reply to formatting usage statements with $0

Why don't you strip $0 first to get only the basename? You may also want to fetch the current value of screen width, and recalcuate the length of all lines when printing the arguments downward, so they're all lined up nicely in the right (I'm not talking about right justify, just so your lines aren't broken unintendedly). May I suggest you to look at Text::Reform? Good luck with your effort to gain the voting power ;-)

Update: (07-07-2007) I really meant "I'm not talking..." instead of "I'm talking..."


Open source softwares? Share and enjoy. Make profit from them if you can. Yet, share and enjoy!

Replies are listed 'Best First'.
Re^2: formatting usage statements with $0
by deorth (Scribe) on Jul 06, 2007 at 20:34 UTC
    Stripping is a good idea. Thanks!

    Text::Reform isn't part of core in either 5.6 or 5.8 as far as I can see. It would reduce portability in my environment (many thousands of machines with different operating systems)

    I try to write only within core for the simple things. I see that Text::Reform would be handy for larger jobs though.

    Thanks for the advice! :)