[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] getopt



Michael Schuerig <uzs90z@ibm.rhrz.uni-bonn.de>
}What do I have to do to specify "commandline" options for scripts run under
}the app version? I tried putting them on the "#!" line, but apparently the
}stuff there gets only passed to the app itself and not to my script.

That's right.  Just as in Unix Perl, things put on the #! line are Perl
switches, not switches for your application.

There are several ways, and they're covered in either the FAQ or in Sandra
Silcot's MacPerl Primer, I don't remember which.  The one I like best is to
throw up a dialog box and ask for them.  I've hacked my copy of Getopt::Std
to do just that, so you can still getopt() or getopts() and use the flags
just as you would from a command line.  I'll send you a copy if you want.
(The only reason I haven't made this generally available yet is that I
really want to have it prompt only if, say, the option key is down, and I
haven't figured out how to do this yet.)  The hack allows you to specify
default values, so you just have to hit return if you want the defaults.

}
}Michael
}
}
}
}***** Want to unsubscribe from this list?
}***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch


---
Paul J. Schinder
NASA Goddard Space Flight Center
Code 693, Greenbelt, MD 20771
schinder@pjstoaster.pg.md.us



***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch