Subject: | preserve $@ on unlabelled expression case |
Date: | Tue, 24 May 2011 09:14:13 +1000 |
To: | bug-Smart-Comments [...] rt.cpan.org |
From: | Kevin Ryde <user42 [...] zip.com.au> |
With Smart::Comments 1.0.4 and recent debian i386 perl 5.12.3, a program
use Smart::Comments;
$@ = 'hello';
print "\$@ is '$@'\n";
### abs(-123)
print "\$@ is '$@'\n";
prints
$@ is 'hello'
### abs(-123): 123
$@ is ''
where I thought the diagnostic print might leave $@ unchanged.
I struck this when putting some prints in code mucking about with eval
and $@. With the smart comments enabled the error messages disappeared.