@@ -56,32 +56,32 @@ traditional way (although you can) to do a filetest. You can simply append
56
56
C < .IO > to the filename. For instance, here is how to check if a file is
57
57
readable using smart match:
58
58
59
- C < '/path/to/file'.IO ~~ :r >
59
+ C < '/path/to/file'.IO ~~ :r >
60
60
61
61
You can, of course, use an already opened filehandle. Here, using the file
62
62
handle C < $fh > , is an example, using the method syntax for the file test:
63
63
64
- C < $fh.r >
64
+ C < $fh.r >
65
65
66
66
Most of the former filetests have colon equivalents for use with smart match:
67
67
68
- :e Exists
69
- :d Directory
70
- :f File
71
- :l Symbolic link
72
- :r Readable
73
- :w Writable
74
- :x Executable
75
- :s Size
76
- :z Zero size
68
+ :e Exists
69
+ :d Directory
70
+ :f File
71
+ :l Symbolic link
72
+ :r Readable
73
+ :w Writable
74
+ :x Executable
75
+ :s Size
76
+ :z Zero size
77
77
78
78
All of these tests can be used as methods (without the colon).
79
79
80
80
Three tests, however, I < only > have method equivalents:
81
81
82
- C < -M $fh > => C < $fh.modified >
83
- C < -A $fh > => C < $fh.accessed >
84
- C < -C $fh > => C < $fh.changed >
82
+ C < -M $fh > => C < $fh.modified >
83
+ C < -A $fh > => C < $fh.accessed >
84
+ C < -C $fh > => C < $fh.changed >
85
85
86
86
The remaining filetests in Perl 5 do not appear to be implemented
87
87
in Perl 6.
@@ -130,8 +130,8 @@ find a true analog.
130
130
Available as a function as well as being able to be used as a method.
131
131
For instance, these are equivalent:
132
132
133
- C < atan2(100) >
134
- C < 100.atan2 >
133
+ C < atan2(100) >
134
+ C < 100.atan2 >
135
135
136
136
= head2 bind
137
137
@@ -229,8 +229,8 @@ Similar to the Perl 5 version, coerces the target to an integer, and uses that
229
229
as a Unicode code point to return the relevant character. Can be used as a
230
230
function and a method:
231
231
232
- C < chr(65); # "A" >
233
- C < 65.chr; # "A" >
232
+ C < chr(65); # "A" >
233
+ C < 65.chr; # "A" >
234
234
235
235
= head2 chroot
236
236
@@ -389,8 +389,8 @@ shell($command);>
389
389
390
390
In Perl 6, this is not a function, but an adverb:
391
391
392
- C < %hash{$key}:exists; >
393
- C < @array[$i]:exists; >
392
+ C < %hash{$key}:exists; >
393
+ C < @array[$i]:exists; >
394
394
395
395
= head2 exit
396
396
@@ -879,9 +879,9 @@ deals with newlines. Details at L<http://doc.perl6.org/routine/open>.
879
879
880
880
Not a builtin function in Perl 6. You would use the IO::Path class:
881
881
882
- C < my $dir = IO::Path.new("directory") >
882
+ C < my $dir = IO::Path.new("directory") >
883
883
884
- C < my $dir = "directory".IO; # Same, but probably more direct >
884
+ C < my $dir = "directory".IO; # Same, but probably more direct >
885
885
886
886
= head2 ord
887
887
@@ -1013,9 +1013,9 @@ L<append method|/type/Array#method_append>.
1013
1013
1014
1014
These survive the transition to Perl 6. Some notes:
1015
1015
1016
- C < q/.../ > is still equivalent to using single quotes.
1017
- C < qq/.../ > is still equivalent to using double quotes.
1018
- C < qw/.../ > is more commonly rendered as C << <...> >> in Perl 6.
1016
+ C < q/.../ > is still equivalent to using single quotes.
1017
+ C < qq/.../ > is still equivalent to using double quotes.
1018
+ C < qw/.../ > is more commonly rendered as C << <...> >> in Perl 6.
1019
1019
1020
1020
There are some added quoting constructs and equivalents, as explained at
1021
1021
L < http://doc.perl6.org/language/quoting > .
@@ -1364,41 +1364,41 @@ also now works as a method: C<"a;b;c".split(';')>
1364
1364
1365
1365
Works as in Perl 5. The formats currently available are:
1366
1366
1367
- % a literal percent sign
1368
- c a character with the given codepoint
1369
- s a string
1370
- d a signed integer, in decimal
1371
- u an unsigned integer, in decimal
1372
- o an unsigned integer, in octal
1373
- x an unsigned integer, in hexadecimal
1374
- e a floating-point number, in scientific notation
1375
- f a floating-point number, in fixed decimal notation
1376
- g a floating-point number, in %e or %f notation
1377
- X like x, but using uppercase letters
1378
- E like e, but using an uppercase "E"
1379
- G like g, but with an uppercase "E" (if applicable)
1367
+ % a literal percent sign
1368
+ c a character with the given codepoint
1369
+ s a string
1370
+ d a signed integer, in decimal
1371
+ u an unsigned integer, in decimal
1372
+ o an unsigned integer, in octal
1373
+ x an unsigned integer, in hexadecimal
1374
+ e a floating-point number, in scientific notation
1375
+ f a floating-point number, in fixed decimal notation
1376
+ g a floating-point number, in %e or %f notation
1377
+ X like x, but using uppercase letters
1378
+ E like e, but using an uppercase "E"
1379
+ G like g, but with an uppercase "E" (if applicable)
1380
1380
1381
1381
Compatibility:
1382
1382
1383
- i a synonym for %d
1384
- D a synonym for %ld
1385
- U a synonym for %lu
1386
- O a synonym for %lo
1387
- F a synonym for %f
1383
+ i a synonym for %d
1384
+ D a synonym for %ld
1385
+ U a synonym for %lu
1386
+ O a synonym for %lo
1387
+ F a synonym for %f
1388
1388
1389
1389
Perl 5 (non-)compatibility:
1390
1390
1391
- n produces a runtime exception
1392
- p produces a runtime exception
1391
+ n produces a runtime exception
1392
+ p produces a runtime exception
1393
1393
1394
1394
There are modifiers for integers, but they're mainly no-ops, as the
1395
1395
semantics aren't settled:
1396
1396
1397
- h interpret integer as native "short" (typically int16)
1398
- l interpret integer as native "long" (typically int32 or int64)
1399
- ll interpret integer as native "long long" (typically int64)
1400
- L interpret integer as native "long long" (typically uint64)
1401
- q interpret integer as native "quads" (typically int64 or larger)
1397
+ h interpret integer as native "short" (typically int16)
1398
+ l interpret integer as native "long" (typically int32 or int64)
1399
+ ll interpret integer as native "long long" (typically int64)
1400
+ L interpret integer as native "long long" (typically uint64)
1401
+ q interpret integer as native "quads" (typically int64 or larger)
1402
1402
1403
1403
= head2 sqrt
1404
1404
0 commit comments