Created
June 2, 2015 20:41
-
-
Save mishin/43f69757aea79f2e4d25 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use strict; | |
use warnings; | |
use 5.010; | |
use Path::Iterator::Rule; | |
use File::Slurp; | |
die "Usage: $0 DIRs" if not @ARGV; | |
my $rule = Path::Iterator::Rule->new; | |
$rule->name("*.sql"); | |
my $big_sql = $ARGV[0] . '/big.sql'; | |
my $it = $rule->iter(@ARGV); | |
while (my $file = $it->()) { | |
say "$file was added to $big_sql"; | |
write_file($big_sql, {append => 1}, read_file($file)); | |
} | |
#thanks for Gabor |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment