Re: Appending to a string

2003-03-14 Thread deb
Doh, you're sooo right. Thanks, d John W. Krahn <[EMAIL PROTECTED]> had this to say, > Deb wrote: > > > > Wait. Using this construct, I can't seem to get the change to write out to > > the file, like I can to stdout. > > > > > > while () { > > > if ( /^That_Text\s=\s2/ ) { > > >

Re: Appending to a string

2003-03-14 Thread Rob Dixon
Deb wrote: > > Wait. Using this construct, I can't seem to get the change to write > out to the file, like I can to stdout. > [snip] > > Here's my code. > > sub editConfSettings { > > open (IN, "tmpconf") or die "cannot open for reading: $!\n"; > open (OUT, "conf")or die "cannot open for writi

Re: Appending to a string

2003-03-13 Thread John W. Krahn
Deb wrote: > > Wait. Using this construct, I can't seem to get the change to write out to > the file, like I can to stdout. > > > > while () { > > if ( /^That_Text\s=\s2/ ) { > > $_ .= $addText; > >}else { > > s/^This_Text.*$/That_Text = 2/; > >} > > You

Re: Appending to a string

2003-03-13 Thread deb
Wait. Using this construct, I can't seem to get the change to write out to the file, like I can to stdout. > > while () { > if ( /^That_Text\s=\s2/ ) { > $_ .= $addText; >}else { > s/^This_Text.*$/That_Text = 2/; >} > You don't need the $_ since this is

Re: Appending to a string

2003-03-13 Thread R. Joseph Newton
deb wrote: > Hi, > > I am modifying a file and replacing a string that I find, which works just > fine. However, sometimes there is already a string there that I don't want to > replace, but instead append something to it. > > Here's what I've got so far: (obligatory use statements not included h

Re: Appending to a string

2003-03-13 Thread david
Deb wrote: > Hi, > > I am modifying a file and replacing a string that I find, which works just > fine. However, sometimes there is already a string there that I don't > want to replace, but instead append something to it. > > Here's what I've got so far: (obligatory use statements not included

Re: Appending to a string

2003-03-13 Thread deb
Kewl! I didn't know you could do that, $_ .= $sometext; That's just what I needed. Beats the heck out of the search and replace I was doing when I didn't need to. Thanks all! d Wags had this to say, > if ( /^That_Text\s=\s2/ ) { > $_ .= $addText; >}els

Re: Appending to a string

2003-03-13 Thread Rob Dixon
Deb wrote: > Hi, > > I am modifying a file and replacing a string that I find, which works > just fine. However, sometimes there is already a string there that I > don't want to replace, but instead append something to it. > > Here's what I've got so far: (obligatory use statements not included >

RE: Appending to a string

2003-03-13 Thread Wagner, David --- Senior Programmer Analyst --- WGO
deb wrote: > Hi, > > I am modifying a file and replacing a string that I find, which works > just fine. However, sometimes there is already a string there that I > don't want to replace, but instead append something to it. > > Here's what I've got so far: (obligatory use statements not included

Appending to a string

2003-03-13 Thread deb
Hi, I am modifying a file and replacing a string that I find, which works just fine. However, sometimes there is already a string there that I don't want to replace, but instead append something to it. Here's what I've got so far: (obligatory use statements not included here) while () {