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 (<IN>) {
> > if ( /^That_Text\s=\s2/ ) {
> > $_ .= $addText;
> > }else {
> > s/^This_Text.*$/That_Text = 2/;
> > }
> > You don't need the $_ since this is the default for regex searches and replaces.
>
> The line at ^shield remains untouched. The other lines modify the file just fine.
>
> Here's my code.
>
> sub editConfSettings {
>
> open (IN, "tmpconf") or die "cannot open for reading: $!\n";
> open (OUT, "conf") or die "cannot open for writing: $!\n";
^^^^^^^^^^^ ^^^^^^^^^^^^^^^^
You are opening "conf" for INPUT - you cannot write to it.
open OUT, '>', 'conf' or die "cannot open for writing: $!\n";
John
--
use Perl;
program
fulfillment
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]