#!/usr/bin/perl use strict; use warnings; use File::Find; my $string = ''; my $cdpath='E:/'; my $cdfiles; find (sub{ $cdfiles.=do{ local ( @ARGV,$/ ) = $File::Find::name; <> }; },$cdpath); for my $file2 ( $cdfiles ) { $string .= do{ local ( @ARGV,$/ ) = $file2; <> }; print $file2; }