summaryrefslogtreecommitdiff
path: root/t/run
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2002-04-16 03:59:00 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2002-04-16 03:59:00 +0000
commit82686b017bb20f55e16f84c47f7ac0bf8d0c714b (patch)
treee7ad28a90ea768b323c2fb37103841ceb7b8dd93 /t/run
parent58858581d2d18dc2bff021fb2c755408c36929c4 (diff)
downloadperl-82686b017bb20f55e16f84c47f7ac0bf8d0c714b.tar.gz
my $utf8here, our $utf8here, and package variable $utf8here.
The actual minimal fix is in utf8.c and from NI-S, the rest are the tests (in fresh_perl since I couldn't get them easily to work elsewhere) and a slight behaviour change: previously UTF-8 identifiers had to start with an alphabetic character. No more so, now they can start with an (Unicode) ID_Continue character (which however is not a (Unicode) digit). (Limiting the first character to ID_Start would be rather restrictive, since ID_Start allows only alphabetic letters.) TODO: use vars qw($utf8here). This I don't find to be a showstopper. p4raw-id: //depot/perl@15943
Diffstat (limited to 't/run')
-rw-r--r--t/run/fresh_perl.t23
1 files changed, 23 insertions, 0 deletions
diff --git a/t/run/fresh_perl.t b/t/run/fresh_perl.t
index 79aae7a04a..8a334a58b1 100644
--- a/t/run/fresh_perl.t
+++ b/t/run/fresh_perl.t
@@ -788,3 +788,26 @@ package main;
$test = Foo->new(); # must be package var
EXPECT
ok
+######## example from Camel 5, ch. 15, pp.406 (with my)
+use strict;
+use utf8;
+my $人 = 2; # 0xe4 0xba 0xba: U+4eba, "human" in CJK ideograph
+$人++; # a child is born
+print $人, "\n";
+EXPECT
+3
+######## example from Camel 5, ch. 15, pp.406 (with our)
+use strict;
+use utf8;
+our $人 = 2; # 0xe4 0xba 0xba: U+4eba, "human" in CJK ideograph
+$人++; # a child is born
+print $人, "\n";
+EXPECT
+3
+######## example from Camel 5, ch. 15, pp.406 (with package vars)
+use utf8;
+$人 = 2; # 0xe4 0xba 0xba: U+4eba, "human" in CJK ideograph
+$人++; # a child is born
+print $人, "\n";
+EXPECT
+3