This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
[perl #113012] String negation under ‘use integer’
authorFather Chrysostomos <sprout@cpan.org>
Sat, 30 Jun 2012 00:34:38 +0000 (17:34 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Sat, 30 Jun 2012 05:20:13 +0000 (22:20 -0700)
commit1c2b3fd6f10f07e101845ead8e14f613c1b487de
treebdbb14755292143fa14bacd4d2d03f412509b9a9
parentf87fa3355a3a1f41c9bc2160d98d7e7e16bdd9ea
[perl #113012] String negation under ‘use integer’

This makes the negation operator under the integer pragma (i_int) use
the same logic for determining whether to do string negation as the
regular negation operator.

Before, this did not happen at all under the integer pragma, except
for barewords, resulting in strange inconsistencies:

$ perl -le 'use integer; print -foo'
-foo
$ perl -le 'use integer; print -"foo"'
0

The code for string negation is now in a static routine in pp.c and is
used by both types of negation.
pp.c
t/op/negate.t