in reply to Re: Form letters: eval a string to substutite perl variables
in thread Form letters: eval a string to substutite perl variables
I want to slurp it in:"Dear $row->{name}; thanks for giving us money."
Then substitue in a loop:undef($/); $block = <FILE>;
The idea is to use perl syntax and the perl parser for the substitution, rather than a made up syntax (e.g. %NAME% and s/%NAME%/$name/). Is this crazy?$sql = "select email,name from database"; while( $row=getrow($sql) ) { print "Working on $row->{name}\n"; eval{$block); send_email($row->{email},$block); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Form letters: eval a string to substutite perl variables
by Joost (Canon) on Oct 27, 2006 at 22:50 UTC | |
by ikegami (Patriarch) on Oct 27, 2006 at 23:39 UTC | |
by Joost (Canon) on Oct 27, 2006 at 23:50 UTC | |
by Fletch (Bishop) on Oct 28, 2006 at 15:10 UTC |