Bitwise IO: Difference between revisions

m
→‎{{header|Perl}}: future-proof for 5.36, explicit :prototype
(Replace println() with print())
m (→‎{{header|Perl}}: future-proof for 5.36, explicit :prototype)
Line 2,452:
(Buffer.contents buf)</syntaxhighlight>
=={{header|Perl}}==
<syntaxhighlight lang="perl">#!use /usr/bin/perlstrict;
 
use strict;
 
# $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)-->
2,392

edits