A simple database of these relevant file names could be just what you need? I would need to know more about what the usage is.
A serious thing to consider is what happens when some file name is deleted as *text and how that affects your directory structure? Your program should have the property that it produces a valid result again and again even if some "line" is missing from the next run...
As an extra note...there is no need at all to use these $1, $2,$3 variables in almost all cases in Perl. There are of course exceptions...
This is called "array slice" and is powerful.my ($seq,$nr,...) =( /prefix_(\d+)_(\d+)_(\w+)(_)(\w+)(_)(\w+)(\.)(\w+)/)[1,2,3...];
I figure that your regex is flawed. Do not use () to capture any thing that is not needed. These $1,$2,$3 variables are expensive. This \w+ then followed by "_" can also be "expensive". The underscore is part of the \w character set, a-zA-Z0-9_-.
In reply to Re: mkdir in loop - overwrite danger?
by Marshall
in thread mkdir in loop - overwrite danger?
by fasoli
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |