{ # This code must be provided $output and $ext. local $/ = \4096; # Limit the size of our block. local *OUT; open(OUT, "> $output") or die("Can't create output file: $!"); binmode(OUT); local $_; while (glob("*.$ext")) { local *IN; open(IN, "< $_") or die("Can't open input file $_: $!"); binmode(IN); { local $_; print OUT $_ while ; } } }