----- Original Message ----- 
From: "pelp" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, September 06, 2002 9:12 PM
Subject: Unable to save changes using IO::File


> Hi -
> 
> The problem is that I'm unable to save my changes after making
> subsitutions, and I don't understand why.
> 
> Here's the code.
> 
> --
> 
> #!/usr/vendor/bin/perl
> use strict;
> use IO::File
> 
> my $FRAME_FILE = new IO::File;
> my $change_on  = "FChangeBar Yes";
> my $change_off = "FchangeBar No";
> 
> 
> $FRAME_FILE -> open("+<test.mif") or die "can't open file";
> 
> while (<$FRAME_FILE>)
> {
>    if (/$change_on/)
>    {
>       s/$change_on/$change_off/g;
>    }
> }
> 
> $FRAME_FILE -> close;
> 
> --
> 
> After debugging the code myself for a bit, I don't see where the
> problem could lay.

Short answer: You aren't writing to the file anywhere.
Medium answer: What you're trying is the wrong approach.
Long answer: Read the FAQ article: 

   perldoc -q 'change one line'



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to