in reply to Command Line Options without "-" or "- -"

I would have gone this way:
$option_line = join ' ', @ARGV; #reconstitute my @pairs = $option_line =~ m/(\w+:\s+\w+)/g; # grab option pairs my %option; for $pair (@pairs) { # now split my ($name,$value) = split ":\s+", $pair, 2; # save each pair in hash $option{$name} = $value; }
Or you could use G::D, but this might be overkill:
our %opt_hash; #can't use my use Getopt::Declare; my $spec = q{ <name>: <value> Name/Value pair { $::opt_hash{$name} = $value; } [repeatable] }; # untested
(I can't recall if whitespace is automagically optional, and I have to run %/;)

Update: Missing $option_line corrected.

-QM
--
Quantum Mechanics: The dreams stuff is made of

Replies are listed 'Best First'.
Re^2: Command Line Options without "-" or "- -"
by parv (Parson) on May 16, 2006 at 18:25 UTC
    $option_line = join ' ', @ARGV; #reconstitute my @pairs = m/(\w+:\s+\w+)/g; # grab option pairs
    You missed matching against "$option_line" ...
    my @pairs = ( $option_line =~ m/(\w+:\s+\w+)/g );