in reply to Re^2: Getopt::Long subroutine usage
in thread Getopt::Long subroutine usage

You have an interesting case here. Personally, I don't see anything wrong with the approach you've started with, and I think trying to stuff subroutine refs into the GetOpt::Long usage to handle option dependencies is just going to obfuscate things. You don't need to go there, IMO. (I would especially advise against any approach the requires the options to be given in a specific order; this goes against the nature of option usage as most command-line users understand it.)

Apart from that, I have just a few nit-picks:

Replies are listed 'Best First'.
Re^4: Getopt::Long subroutine usage
by rockneybot (Novice) on Jan 05, 2005 at 08:21 UTC
    I guess the path I'm taking will work. I just assumed that someone had been down this path before and had come up with a comprehensive way of handling options in a multi-purpose script. I definitely agree that the script should not require that options be given in a specific order. Thanks for the nit-picks! I plan to add a --help option or use auto_help built in to the module. The POD needs work, that's for certain. Hah! The description was nabbed straight from the Getopt::Long docs. I'll change it. Um, I forgot about mkdir and chmod builtins. The ls function is necessary, but the die is not. Since I'm using automount, the filesystem isn't mounted until the path is read. I suppose I could mount the filesystem to a temp location, but that seems like more work, more lines of code, more cleanup. The get_line sub and the remove_line subs are not currently being used. I should have removed them before posting.