Dan Sugalski wrote:
>If we do, then something as simple as this:
>
>   while (<IN>) {
>         $count++ if /bar/;
>         print OUT $_;
>   }
>
>would potentially result in the output file being rather different from the
>input file. Equivalent, yes, but different. Whether that's bad or not is an
>open question.

I don't believe that any scalar defined within the parsed application space
should be transformed permanently. There shouldn't be any difference between
the input file and the output file in the above example (it could cause issues
with non-Perl apps).
I think the rule should be to store normalized scalars as separate from the
original and leave the original unaffected.
There are specific cases where it would be OK to normalize the original, such
as error strings, and other scalars used internally by Perl. Perhaps the
developer could 'use normalize' to force the scalars to be normalized for
optimization purposes, but Perl shouldn't force normalization.
Grant M.


Reply via email to