or_files.pl 356 B

12345678910111213141516171819202122232425
  1. #!/usr/bin/perl
  2. # OR two or more files together into one file.
  3. use 5.014;
  4. use strict;
  5. use warnings;
  6. my $data = '';
  7. foreach my $file (@ARGV) {
  8. my $content = do {
  9. open my $fh, '<:raw', $file
  10. or die "Can't open <<$file>>: $!";
  11. local $/;
  12. <$fh>;
  13. };
  14. $data |= $content;
  15. }
  16. binmode(STDOUT, ':raw');
  17. print $data;