--- Bob Bondi <[EMAIL PROTECTED]> wrote:
> Thanks for the feedback, everyone.
> My goal for this script is to make "this.gif" and "that.gif" change
> places in the file. I.E.
> -----------------
> this.gif
> that.gif
> this.gif
> -----------------
> 
> after running the script I would have
> -----------------
> that.gif
> this.gif
> that.gif
> -----------------
> 
> using code like:
> s/$sThis/$sThat/;
> s/$sThat/$sThis/;
> 
> is there a method to do this?
> 
> I am running into a situation that I end up with just this.gif.
> I guess what would be nice is:
> s/(value1,value2)/(newValue1,newValue2)/
> where value1 becomes NewValue1 OR value2 becomes newValue2

Your code currently converts the second one successfully on every line,
because lines that wouldn't have matched are being altered by the first
so that they do.

Make them conditional. maybe:

 s/$sThis/$sThat/ unless s/$sThat/$sThis/;




__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/

Reply via email to