exactly as if you wrote this
I get the point you're trying to make and I made a very similar one in my post, but note that this part isn't accurate, since do is different from eval in that code run by do can't see lexicals in the enclosing scope. Specifically:
use warnings; use strict; use Path::Tiny 'path'; my $var = \"09"; my $transf = "/3+6"; print eval('$$var'.$transf),"\n"; # prints 9 path('third')->spew('$$var'.$transf); print do('third'),"\n"; # prints 6
Because in the file third, neither warnings or strict are in effect and it can't see my $var, it's the same as undef()/3+6. (Of course if you s/my/our/g, it does work.)
In reply to Re^2: Please help me understand string eval better
by haukex
in thread Please help me understand string eval better
by perltux
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |