Perhaps I'm totally off base, but if your just looking for a simple hash $hash{$key}=$value; for each option, this should be fairly easy to do.

Since all of the args are automatically split by the shell, the hardest part is out of your way. All should have to do is this:
my %hash; for(@ARGV) { my($key,$val) = split/=/,$_,2; $hash{$key}=$val; } use Data::Dumper; print Dumper(\%hash); __END__ Output: $VAR1 = { 'vchtyp' => 'I', 'jrnltyp' => 'D', 'title' => '\'this is a title\'', 'lexwhere' => '\'in(\'DIS\', \'DIM\', \'DIR\')\'' }; (Data::Dumper is inserting those extraneous backslashes, ignore them)
Now if you wanted to parse some values into more complicated data structures then just scalars, well, it gets slightly more complicated. For example, the lexwhere key. You might be able to get away with something like:
my @vals = $hash{lexwhere}=~/'([^'])'/;
But thats really fragile and requires having strict controls over what gets passed to your script. (in fact, it's so fragile it doesn't even work on the data as presented, you'll need to munge off the beginning and ending single quotes)

In reply to Re: parsing arguments by BUU
in thread parsing arguments by mifflin

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.