use File::Slurp qw/ read_file append_file /; append_file('A.txt', read_file('B.txt'));