Anonymous user
Host introspection: Difference between revisions
→{{header|Perl 6}}: Replace experimental pack with a native solution (taken from C example)
No edit summary |
(→{{header|Perl 6}}: Replace experimental pack with a native solution (taken from C example)) |
||
Line 836:
</pre>
=={{header|Perl 6}}==
Endian detection translated from C. {{works with|Rakudo|2018.03}}
<lang perl6>use
say $*VM.config<ptr_size>;
my $bytes = nativecast(CArray[uint8], CArray[uint16].new(1));
say $bytes[0] ?? "little-endian" !! "big-endian;</lang>
{{out}}
<pre>8
|