Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
More indentation for better web rendering
  • Loading branch information
dha committed Nov 11, 2015
1 parent 601a8f0 commit 3bff9ad
Showing 1 changed file with 47 additions and 47 deletions.
94 changes: 47 additions & 47 deletions doc/Language/5to6-perlfunc.pod
Expand Up @@ -56,24 +56,24 @@ traditional way (although you can) to do a filetest. You can simply append
C<.IO> to the filename. For instance, here is how to check if a file is
readable using smart match:
C<'/path/to/file'.IO ~~ :r>
C<'/path/to/file'.IO ~~ :r>
You can, of course, use an already opened filehandle. Here, using the file
handle C<$fh>, is an example, using the method syntax for the file test:
C<$fh.r>
C<$fh.r>
Most of the former filetests have colon equivalents for use with smart match:
:e Exists
:d Directory
:f File
:l Symbolic link
:r Readable
:w Writable
:x Executable
:s Size
:z Zero size
:e Exists
:d Directory
:f File
:l Symbolic link
:r Readable
:w Writable
:x Executable
:s Size
:z Zero size
All of these tests can be used as methods (without the colon).
Expand Down Expand Up @@ -130,8 +130,8 @@ find a true analog.
Available as a function as well as being able to be used as a method.
For instance, these are equivalent:
C<atan2(100)>
C<100.atan2>
C<atan2(100)>
C<100.atan2>
=head2 bind
Expand Down Expand Up @@ -229,8 +229,8 @@ Similar to the Perl 5 version, coerces the target to an integer, and uses that
as a Unicode code point to return the relevant character. Can be used as a
function and a method:
C<chr(65); # "A">
C<65.chr; # "A">
C<chr(65); # "A">
C<65.chr; # "A">
=head2 chroot
Expand Down Expand Up @@ -389,8 +389,8 @@ shell($command);>
In Perl 6, this is not a function, but an adverb:
C<%hash{$key}:exists;>
C<@array[$i]:exists;>
C<%hash{$key}:exists;>
C<@array[$i]:exists;>
=head2 exit
Expand Down Expand Up @@ -879,9 +879,9 @@ deals with newlines. Details at L<http://doc.perl6.org/routine/open>.
Not a builtin function in Perl 6. You would use the IO::Path class:
C<my $dir = IO::Path.new("directory")>
C<my $dir = IO::Path.new("directory")>
C<my $dir = "directory".IO; # Same, but probably more direct>
C<my $dir = "directory".IO; # Same, but probably more direct>
=head2 ord
Expand Down Expand Up @@ -1013,9 +1013,9 @@ L<append method|/type/Array#method_append>.
These survive the transition to Perl 6. Some notes:
C<q/.../> is still equivalent to using single quotes.
C<qq/.../> is still equivalent to using double quotes.
C<qw/.../> is more commonly rendered as C<< <...> >> in Perl 6.
C<q/.../> is still equivalent to using single quotes.
C<qq/.../> is still equivalent to using double quotes.
C<qw/.../> is more commonly rendered as C<< <...> >> in Perl 6.
There are some added quoting constructs and equivalents, as explained at
L<http://doc.perl6.org/language/quoting>.
Expand Down Expand Up @@ -1364,41 +1364,41 @@ also now works as a method: C<"a;b;c".split(';')>
Works as in Perl 5. The formats currently available are:
% a literal percent sign
c a character with the given codepoint
s a string
d a signed integer, in decimal
u an unsigned integer, in decimal
o an unsigned integer, in octal
x an unsigned integer, in hexadecimal
e a floating-point number, in scientific notation
f a floating-point number, in fixed decimal notation
g a floating-point number, in %e or %f notation
X like x, but using uppercase letters
E like e, but using an uppercase "E"
G like g, but with an uppercase "E" (if applicable)
% a literal percent sign
c a character with the given codepoint
s a string
d a signed integer, in decimal
u an unsigned integer, in decimal
o an unsigned integer, in octal
x an unsigned integer, in hexadecimal
e a floating-point number, in scientific notation
f a floating-point number, in fixed decimal notation
g a floating-point number, in %e or %f notation
X like x, but using uppercase letters
E like e, but using an uppercase "E"
G like g, but with an uppercase "E" (if applicable)
Compatibility:
i a synonym for %d
D a synonym for %ld
U a synonym for %lu
O a synonym for %lo
F a synonym for %f
i a synonym for %d
D a synonym for %ld
U a synonym for %lu
O a synonym for %lo
F a synonym for %f
Perl 5 (non-)compatibility:
n produces a runtime exception
p produces a runtime exception
n produces a runtime exception
p produces a runtime exception
There are modifiers for integers, but they're mainly no-ops, as the
semantics aren't settled:
h interpret integer as native "short" (typically int16)
l interpret integer as native "long" (typically int32 or int64)
ll interpret integer as native "long long" (typically int64)
L interpret integer as native "long long" (typically uint64)
q interpret integer as native "quads" (typically int64 or larger)
h interpret integer as native "short" (typically int16)
l interpret integer as native "long" (typically int32 or int64)
ll interpret integer as native "long long" (typically int64)
L interpret integer as native "long long" (typically uint64)
q interpret integer as native "quads" (typically int64 or larger)
=head2 sqrt
Expand Down

0 comments on commit 3bff9ad

Please sign in to comment.