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/ ) {
> > >
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
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
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
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
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
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
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
>
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
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 () {
10 matches
Mail list logo