Re: [MacPerl-Porters] command-line options

[email protected] (Chris Nandor) Sat, 17 Nov 2001 07:53:49 -0500
Newsgroups perl.macperl.anyperl,perl.macperl.porters
Message-ID <p05100302b81c0cf2521d@[10.0.1.177]>
Try this on for size:

	use Getopt::Std;

	BEGIN { if ($^O eq 'MacOS' && !@ARGV) {
		@ARGV = split ' ', MacPerl::Ask('Command line options?');
	} }

	getopts('oif:', \%opts);
	print $opts{f};

I am not convinced modifying the modules is appropriate, though.  Often,
you won't necessarily want to pass options, just because one of those
modules (oe even -s) is used.  I know on Unix I have plenty of programs
that can accept input in that manner, but often don't.  So bringing up the
box each time would be kinda ... annoying.

-- 
Chris Nandor                      [email protected]    http://pudge.net/
Open Source Development Network    [email protected]     http://osdn.com/