rahul_lfo has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl use strict; use warnings; sub MakeDirs($$$); MakeDirs("C:\\Documents and Settings\\Rahul\\Desktop\\perl\\directory\ +\New2", 15, 2); sub MakeDirs($$$) { my($base, $num_dirs, $depth) = @_; mkdir $base; #if depth = 0, no more subdirectories need to be created if($depth == 0) { return 0; } #Recurse through the directories my $dir_name = "a"; for(my $x = 10; $x < $num_dirs; $x++) { MakeDirs("$base/$dir_name", $num_dirs, $depth - 1); $dir_name++; } open(DIR, ">>contacts".$i.".json"); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Perl Script to create sample files in each directories created.
by kcott (Archbishop) on Oct 08, 2013 at 09:35 UTC | |
|
Re: Perl Script to create sample files in each directories created.
by Laurent_R (Canon) on Oct 08, 2013 at 11:58 UTC | |
by rahul_lfo (Initiate) on Oct 09, 2013 at 15:25 UTC | |
|
Re: Perl Script to create sample files in each directories created.
by Anonymous Monk on Oct 08, 2013 at 09:21 UTC | |
|
Re: Perl Script to create sample files in each directories created.
by Laurent_R (Canon) on Oct 09, 2013 at 16:59 UTC |