Bitwise IO: Difference between revisions
m
→{{header|Perl}}: future-proof for 5.36, explicit :prototype
(Replace println() with print()) |
SqrtNegInf (talk | contribs) m (→{{header|Perl}}: future-proof for 5.36, explicit :prototype) |
||
Line 2,452:
(Buffer.contents buf)</syntaxhighlight>
=={{header|Perl}}==
<syntaxhighlight lang="perl">
# $buffer = write_bits(*STDOUT, $buffer, $number, $bits)
sub write_bits :prototype( $$$$ )
{
my ($out, $l, $num, $q) = @_;
Line 2,471 ⟶ 2,469:
# flush_bits(*STDOUT, $buffer)
sub flush_bits :prototype( $$ )
{
my ($out, $b) = @_;
Line 2,478 ⟶ 2,476:
# ($val, $buf) = read_bits(*STDIN, $buf, $n)
sub read_bits :prototype( $$$ )
{
my ( $in, $b, $n ) = @_;
Line 2,511 ⟶ 2,509:
print pack("C1", $v);
}</syntaxhighlight>
=={{header|Phix}}==
<!--<syntaxhighlight lang="phix">(notonline)-->
|