2008/11/11 karl williamson <public@khwilliamson.com>:
> But there are problems with pragmas. As I've discovered, the charnames
> pragma goes away in an eval. That this should happen was not obvious to me,
> and I suspect not so to the average Perl progammer. It doesn't DWIM, and
> I'm not convinced it is the right thing to do. It means that complementing
> the default from release to release can cause programs to have to add pragma
> calls to their evals.
To me it's a bug. Actually that might be caused by charnames storing
an arrayref in %^H. But I don't reproduce it with 5.10 (the script
below works). Do you have some test code ?
use strict;
use warnings;
use 5.01;
use charnames 'greek';
say "\N{sigma} is Greek sigma";
eval { say "\N{sigma} is Greek sigma"; };
eval ' say "\N{sigma} is Greek sigma"; ';