Front page | perl.module-authors |
Postings from May 2004
From: Eric Wilhelm
May 5, 2004 20:57
Message ID: firstname.lastname@example.org
I'm looking for a module which would operate similar to the following example.
If anyone has suggestions or feedback, I'd like to hear them. (I'd really
like to here "it's already been solved".)
In the event that it hasn't been solved, suggestions on the name and interface
are just as welcome.
It seems like a fairly generic problem. I'm actually planning on using it as
a component in an image organizational system this week and a cad application
sometime in the near future. Basically, you have some table of values, and
want to make some set of those values into the directory names in a nested
directory tree, possibly using one of them to create the filename at the end.
I've only shown string data in this example, but I've also considered a
filename (which would copy it to said location in the tree.) Probably also a
subroutine ref interface (which would call the referenced subroutine with the
resultant filename as an argument.)
File::Path::Populate - Populate a directory hierarchy with data.
my $fpp = File::Path::Populate->new(base => $basedir);
my @header = qw(farmer_name geese chickens ducks);
my @table = (
["dan", 7, 3, 2],
["joe", 0, 5, 2],
my @structure = qw(
my @data = (
"Mr. Farmer Dan",
"Just call me Joe"
This gives the following tree under $basedir:
| `-- 5
| `-- joe.txt
The file 2/0/5/joe.txt would contain the text "Just call me Joe", while
2/7/3/dan.txt reads "Mr. Farmer Dan".
"It works better if you plug it in!"
by Eric Wilhelm