system("find /clear/pp_00/ngbb/ -name '*.txt' > CCfiles"); open (OUT , "CCfiles" ) or die " can't open CCfiles\n"; while () { # Original code # $_ =~ m/^//\w+////; # print "the someName dir is $_\n"; my @Result = split ( /\//, $_ ); print "the someName dir is $Result[1]\n"; }