Rob Dixon <rob.di...@gmx.com> writes: > Hey Harry > > As Jim says, there is very little chance that you will find an existing > module that conforms to such a tight specification, but such a facility > is trivial to write. Take a look at the program below and see if it > helps you with a solution.
[...] Skipped nifty script First off, this program appears to work flawlessly. I'm really not able to follow the code very far at all. I wonder why it appears to favor uppercase, or really even use uppercase at all. And I was pleasantly surprised with the brevity of the names produced. I don't see where in the code that upper case happens. I'd like to stop it creating any uppercase....not as an urgent necessity but just for ease all around when or if it becomes necessary to type any names. But maybe excluding uppercase would shrink the pool of possible characters too much? I'd also like to introduce a very thin check on the file types, but confine the check just to mechanically examining the extension. Not try to verify that it is in fact an image file. That should not be necessary but there is some likelyhood of discovering a typo or possibly hit some rare types of image format. I used this in my crude little starter program as one part of a foreach loop: if ( !/^.*\.[bjgtp][gimnps][gfadp]$/) { print "<$_> is not a properly named image file .. skipping\n"; next; } Just so I'd have output so as to trace any problematic files if there seemed a need. The regex appears to encompass all the types I want to deal with, but is no doubt horribly written. Its intended to allow: jpg, tif, bmp, gif, tga, png, psd And to reject anything else and just skip it. I think that's all, but may be leaving out some less common types. I'd sooner only deal with types listed there. Gettng back to your code... to tell the truth, I'm pretty much mystified by it.... I haven't looked at any perl for several months and have been busy as a videographer. Taxing your patience a bit, but if you are willing to do still more hand holding, I would benefit a lot if you were to comment the code enough so I could follow the purpose of each major section. -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/