in reply to directory listing

Just remove them.
my $dir = "/opt/DSPKG"; opendir(my $bin_dh, $dirs) or die "Can't open directory $dir: $!\n"; my @subdirs = grep { !/^\.\.?\z/ && -d "$dirs/$_" } readdir $bin_dh; my $pkg_file = '/tmp/pkgtest'; open(my $pkg_fh, '>', $pkg_file) or die "cant open pkgtest $pkg_file: $!\n"; foreach my $subdir (@subdirs) { print $pkg_fh "$subdir\n"; }

Other fixes:

Replies are listed 'Best First'.
Re^2: directory listing
by muizelaar (Sexton) on Sep 17, 2007 at 10:48 UTC
    Thanks You were a great help. :)