I'm probably not completely clear on what you have to do, but this (not 100% perl) solution may give you a hint or two:
use diagnostics;
use strict;
use Data::Dumper;
my %sprockets;
my %cogs;
open FILES, "c:/cygwin/bin/find.exe data -type f -print|" or die "no
+data";
while(<FILES>){
m[sprocket_logs/(\w+)\.(\d+)] and $sprockets{$1} = $2;
m[cog_logs/(\w+)\.(\d+)] and $cogs{$1} = $2;
}
print Dumper(%sprockets, %cogs);
The basic idea here is a two column table with the REs and tasks, separated by "and"s. You could (clearly) make it a 100% Pure Perl solution by writing your own find. It may not solve your problem directly, but it might give you at least a partial idea toward a solution.
HTH, --traveler
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.