Skip to content

Instantly share code, notes, and snippets.

@muraiki muraiki/merge.pl
Last active Aug 29, 2015

Embed
What would you like to do?
merge two files
use strict;
use warnings;
open (my $foo, '<', 'foo.txt') or die;
open (my $bar, '<', 'bar.txt') or die;
open (my $merged, '>', 'merged.txt') or die;
print $merged '#!/bin/sh', "\n";
while (not eof $foo and not eof $bar) {
my $f = <$foo>;
my $b = <$bar>;
chomp($f);
chomp($b);
print $merged "$f /usr/boxes/$b\n";
}
print "Finished.\n";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.