Skip to content

Commit 92b0269

Browse files
committed
Merge branch 'master' of github.com:perl6/perl6-examples
2 parents 9f9be8f + 7db1122 commit 92b0269

File tree

6 files changed

+96
-1
lines changed

6 files changed

+96
-1
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
use v6;
2+
3+
=begin pod
4+
5+
=TITLE Using Named Unicode Chars
6+
7+
=AUTHOR stmuk
8+
9+
=end pod
10+
11+
say "\c[REGISTERED SIGN]";
12+
13+
say uniname("\x1f63E"); # POUTING CAT FACE
14+
15+
# vim: expandtab shiftwidth=4 ft=perl6
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
use v6;
2+
3+
=begin pod
4+
5+
=TITLE Upper/Lower Case
6+
7+
=AUTHOR stmuk
8+
9+
You have a string and what to upper/lower case it
10+
11+
=end pod
12+
13+
my $string = "the cat sat on the mat";
14+
15+
say $string=$string.uc; # THE CAT SAT ON THE MAT
16+
17+
say $string.=lc; # the cat sat on the mat
18+
19+
say $string.wordcase; # The Cat Sat On The Mat
20+
21+
# vim: expandtab shiftwidth=4 ft=perl6
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
use v6;
2+
3+
=begin pod
4+
5+
=TITLE Soundex Matching
6+
7+
=AUTHOR stmuk
8+
9+
You have two surnames and want to know if they sound similar
10+
11+
=end pod
12+
13+
use Algorithm::Soundex;
14+
15+
my Algorithm::Soundex $s .= new();
16+
17+
say $s.soundex("Smith");
18+
say $s.soundex("Smythe");
19+
say $s.soundex("Bloggs");
20+
21+
# vim: expandtab shiftwidth=4 ft=perl6
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
use v6;
2+
3+
=begin pod
4+
5+
=TITLE Complex Numbers
6+
7+
=AUTHOR stmuk
8+
9+
Math with Complex Numbers
10+
11+
=end pod
12+
13+
say (3+5i) * (2-2i); # 16+4i
14+
15+
say sqrt(3+4i); # 2+1i
16+
17+
# vim: expandtab shiftwidth=4 ft=perl6
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
use v6;
2+
3+
=begin pod
4+
5+
=TITLE Convert Bases
6+
7+
=AUTHOR stmuk
8+
9+
Convert between various numerical bases
10+
11+
=end pod
12+
13+
say 0xDEADBEEF;
14+
15+
say 0o755;
16+
say 493.fmt("%o");
17+
18+
say :16<FEEDFACE>;
19+
say 4277009102.base(16);
20+
21+
# vim: expandtab shiftwidth=4 ft=perl6

categories/cookbook/05hashes/05-05traversing.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
}
2626

2727
for %hash {
28-
say $_; # hmm ...
28+
.say;
2929
}
3030

3131
# vim: expandtab shiftwidth=4 ft=perl6

0 commit comments

Comments
 (0)