in reply to Pass the value from perl script to html page
Note that VAR1, VAR2, VAR3, etc. can be any variable names you want.use strict; use warnings; my ($text, %var); $var{VAR1} = 'hawg'; $var{VAR2} = 'mansion'; $var{VAR3} = 'flagpole'; read(DATA, $text, 8192); $text =~ s/<\?(\w+?)\?>/$var{$1}/g; print $text; __DATA__ Once upon a time there was a <?VAR1?> that lived in a <?VAR2?> on top of a <?VAR3?>.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Pass the value from perl script to html page
by Hero Zzyzzx (Curate) on May 04, 2005 at 16:20 UTC |