$i=1;
while($i<3) {
print << “EOT”;
def px$i = new E(user)
if (!px$i.hasErrors()) {
println “${px$i.name} / ${px$i.empr.to} OK”
}
EOT
$i++;
}
produces the error:
Can’t call method “px” without a package or object reference at borrar.pl line 3.
How can I “escape” the if ?
Thanks.
It’s kind of hard to tell what this code is supposed to accomplish, but maybe you want the outer dollar signs in the println statement to be preserved in the final output?
With that change, the error-free output I see is: