flip.pl 224 B

123456789101112131415
  1. #!/usr/bin/perl
  2. # Flip the bits of a given input data stream
  3. use 5.014;
  4. use strict;
  5. use warnings;
  6. binmode(STDIN, ':raw');
  7. binmode(STDOUT, ':raw');
  8. while (<>) {
  9. print pack("C*", map { $_ ^ 255 } unpack("C*", $_));
  10. }