Hi
keiusui,
I would suggest using a hash (or, as in the following example, a hash reference) to contain those variables, in conjunction with map, like this:
use strict;
use warnings;
my $h_vars = {
'name' => '<h1>Fred Flintstone</h1>',
'location' => 'Bedrock',
'favorite movie' => 'One <i>Million</i> Years B.C.',
'favorite book' => 'Danny the <b>Dinosaur</b>',
};
map { s/\</\<\;/g; s/\>/\>\;/g } values %$h_vars;
# Test code
use Data::Dumper;
printf "Results %s\n", Dumper($h_vars);
__END__
Results $VAR1 = {
'location' => 'Bedrock',
'favorite movie' => 'One <i>Million</i> Years B.
+C.',
'name' => '<h1>Fred Flintstone</h1>',
'favorite book' => 'Danny the <b>Dinosaur</b>'
};
s''(q.S:$/9=(T1';s;(..)(..);$..=substr+crypt($1,$2),2,3;eg;print$..$/