in reply to Interpolating $var in a $string
#!perl -w use strict; my %vars = qw(name Fred); my $tmpl = do { local $/; <DATA> }; $tmpl =~ s/\$([a-zA-Z_]\w*)/$vars{$1}/ge; print $tmpl; __DATA__ This is my template. Here is my $name
perl -e"\$_=qq/nwdd\x7F^n\x7Flm{{llql0}qs\x14/;s/./chr(ord$&^30)/ge;print"
|
|---|