in reply to Parse $ Variable in text file
perl -e '$name='kak';$q=do {open(F,"/tmp/file");<F>}; $q=~ s/\$(\w+)/$ +{$1}/g;; print $q' gives: select * from kak cat /tmp/file select * from $name
In my example, the /tmp/file only contains one line, that's why I assigned it to a scalar and not an array.
Hope this helps...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Parse $ Variable in text file
by Juerd (Abbot) on Jan 11, 2005 at 14:30 UTC | |
by gellyfish (Monsignor) on Jan 11, 2005 at 15:17 UTC | |
by insaniac (Friar) on Jan 11, 2005 at 15:09 UTC |