Angel has asked for the wisdom of the Perl Monks concerning the following question:
any clue on how to get this to work?#hash that contins the data %recordData = %$hashRef; #gets the email address $emailAddress = $recordData{ "EmailAddress" }; $message = $original_message; local($/) = undef; foreach $key (keys %recordData) { my $subVar = $recordData{$key}; my $subKey = "\$" . $key; # prints the data to the screen ( debugging ) print "$subKey = $subVar\n"; $message =~ s/\$subKey/$subVar/o; print "$message"; }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Substitution in text files
by Weasel (Sexton) on Jun 15, 2002 at 20:19 UTC | |
Re: Substitution in text files
by jepri (Parson) on Jun 15, 2002 at 20:14 UTC |