in reply to In-place bitwise NOT?
substr can be used as an lvalue:
my $bytes = length( $bits ); for (my $offset = 0; $offset < $bytes; $offset += 4096) { my $chunk = 4096; $chunk = $bytes - $offset if $offset + $bytes > $bytes; substr($bits, $offset, $bytes) = ~ substr($bits, $offset, $bytes); }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: In-place bitwise NOT?
by BrowserUk (Patriarch) on Jul 27, 2013 at 22:51 UTC |
In Section
Seekers of Perl Wisdom