in reply to REGEX with input file

Any number of things may be wrong with your code. You haven't given us enough information to tell. You don't even say what output you are getting instead of what you want. Here are a few ideas of what could be wrong:

Replies are listed 'Best First'.
Re: Re: REGEX with input file
by samy1212 (Novice) on Jan 23, 2004 at 04:41 UTC
    duff , sorry if my question was not clear , ok lets put it this way what if I want to just do : my input fils has only the following
    export O_PREFIX=OLD
    I am doing the follwoing to change the value from OLD to NEW:
    my $newValue='NEW'; s/O_PREFIX=(\w+)/O_PREFIX=$newValue/ if /O_PREFIX=/;
    my code is working and I am reading from the correct file , however my output looks like this
    O_PREFIX=NEWOLD instead of O_PREFIX=NEW
    I hope this make it clear , if not then sorry :(