BlueStarry has asked for the wisdom of the Perl Monks concerning the following question:
If i print the name of the directories with the print i get . ..#!/usr/bin/perl use strict; use warnings; use Text::CSV; my $dir = "C:/Users/ST/DesktopSample"; opendir (my $gdh, $dir) or die "Unable to open main directory"; my @dirs = grep {-d} readdir($gdh); closedir($gdh); foreach my $tumordirs (@dirs) { #opendir (my $tdh, $tumordirs) or die "Unable to open subdir"; print "$tumordirs\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Iterate trough a series of folders
by kennethk (Abbot) on Apr 04, 2016 at 17:42 UTC | |
by BlueStarry (Novice) on Apr 04, 2016 at 18:32 UTC | |
by kennethk (Abbot) on Apr 04, 2016 at 18:52 UTC | |
|
Re: Iterate trough a series of folders
by 1nickt (Canon) on Apr 04, 2016 at 18:56 UTC | |
|
Re: Iterate trough a series of folders
by Laurent_R (Canon) on Apr 04, 2016 at 18:56 UTC | |
|
Re: Iterate trough a series of folders
by Marshall (Canon) on Apr 04, 2016 at 18:13 UTC | |
|
Re: Iterate trough a series of folders
by FreeBeerReekingMonk (Deacon) on Apr 04, 2016 at 18:25 UTC | |
by Discipulus (Canon) on Apr 05, 2016 at 07:32 UTC |