#!/usr/bin/perl -w use strict; use EvalScalar qw($a $b $c); # Only works with globals use vars qw($person $num); $num = 3; # Single-quote the rhs if you want # evaluation of the assignment # delayed until read-time. $a = '$num * 2'; $b = '$a + $num'; $c = '"$num, $a, $b"'; for $num (1..5) { print "\$a=$a, \$b=$b, \$c=$c\n"; } $a = '"Dear $person, this sorta works\n"'; for $person qw(Mom Dad BBQ) { print $a; } $a = '"But unqualified subs will be called in EvalScalar namespace" . foo()'; print $a;