Subject: | expressions and "my" variables |
Date: | Tue, 24 May 2011 09:22:20 +1000 |
To: | bug-Smart-Comments [...] rt.cpan.org |
From: | Kevin Ryde <user42 [...] zip.com.au> |
Smart::Comments 1.0.4 pod shows as an example
### 2 * $prediction
but with recent debian i386 perl 5.12.3 it doesn't seem to work on a
"my" variable,
use Smart::Comments;
my $predition = 123;
### 2 * $prediction
prints
### 2 * $prediction
where from the docs I thought it would be something like
### 2 * $prediction: 246
Is that due to scoping on a string eval in _quiet_eval()? Maybe an
inline block style "eval{2*$expression}" would see more of the context.