Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Re: Doesn't seem complete

by tlhf (Scribe)
on Jun 30, 2002 at 22:48 UTC ( [id://178428]=note: print w/replies, xml ) Need Help??


in reply to Re: Doesn't seem complete
in thread Regular expression double grouping negation headache

Er, the limitation of not being able to parse an equals sign was the one I was talking about it.

Which is cute. Except it fails under some conditions. Let's say you want to give the variable 'foo' the value of 'moo shoo= coo'. I'd assume it would be written 'foo=moo shoo\= coo'. Except your example doesn't allow for this.
Your code wouldn't parse it correctly, although an assertion would be emminently acceptable.

tlhf
xxx

Replies are listed 'Best First'.
Re: Re: Re: Doesn't seem complete
by dreadpiratepeter (Priest) on Jun 30, 2002 at 23:08 UTC
    Once again, you have misunderstood the problem. The string you are passing in will be parsed by the shell as 2 arguments. The first being foo=moo which will properly be parsed as foo => moo. The second being shoo\= coo which will also be properly parsed as shoo\ => coo. In order to embed a space into the tag you need to escape the space, so that the shell will parse it as one argument. Thus making the correct string, foo=moo\ shoo=\ coo
    Try the code I posted on the strings and you will see that it works. the limitation is that it can't parse an equal sign in the key, not in the value as you are trying to do.



    -pete
    "Pain heals. Chicks dig scars. Glory lasts forever."
      "the shell"?

      Well, if you're using a shell which breaks up arguments like that, and that you don't want to run your application under different conditions at any point, then yes, it would work. However, a lot of shells don't. Shells break arguments up in a number of different ways. I usually find the simplist way of making sure my app comparatively portable is to join these elements of ARGV back up. I apologies for not making this clearer at the top of my first post in this thread. And I also apologies for making it clearer that I was pointing out the problems of an equals in the value.

      The example you've given would work under the system you have now like that. But I didn't miss the point, I just explained myself badly.

      tlhf
      xxx

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://178428]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (5)
As of 2024-03-28 22:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found