perl -ple "BEGIN{open $to,'>',shift @ARGV;select $to}" destination.txt source1.txt source2.txt