Hi all:

I'm trying to put a variable value into a text file.  I've tried a few 
things with no success. 

Anyone know how to do this ?  Is it doable ?  I'm pretty sure I read how 
to do this somewhere, so I'm about to hit the Perl books  to see if I can 
find it. 
Any help will be appreciated.

Here's what I last tried.  It doesn't work and I'm embarrassed to even 
show it.  But, I did want to show that at least I'm trying to make it 
work:

use strict;
use warnings;

open (INFILE, "c:\\testmessage.txt") or die "The source file failed to 
open - $!";
my @testarray = <INFILE>;
my $name = "stuart";
print @testarray;

Here's what it prints:  My name is $name.

Here's the testmessage.txt file:  My name is $name.

After running my script, I'd like the testmessage.txt to read:  My name is 
stuart.

Thanks again for any help.

Reply via email to