sub is_dir { my @list = split(//, $_); if( $list[0] eq 'd' ) { return 1; } else { return 0; } }