in reply to Re: RE(5): Parsing command line
in thread Parsing command line

Ok, I assume I got you wrong again...;-)

I figured you have to overwrite @ARGV to get GetOptions to work with you local data. I played a bit with the possibility to turn $input into an array. Unfortunatly I have a meeting right now, I'll get back to it this evening, if you still need help then...

regards,
tomte

Replies are listed 'Best First'.
Re: RE(7): Parsing command line
by hotshot (Prior) on Aug 26, 2002 at 15:17 UTC
    I do overwrite @ARGV, I guess I missed that in my 'cut & paste':
    @ARGV = split(' ', $input);
    I have this row just before the call to parseCmdLine().

    Hotshot

      The error is, that, unlike the shell, you pass

      @ARGV is (-s, "test, drei, vier")
      for $input="-s \"test drei vier\"" (try Getopt::Long::Configure('debug');)

      I can't come up with an easy way (like one regex) to solve this, you have to parse $input a bit more complicated than the split to mimik the bash-behavior


      regards,
      tomte