[oak perl] file::find vs. learning recursive subs
Sandy Santra
santranyc at yahoo.com
Thu Feb 17 23:33:53 PST 2005
Belden, that script was amazing--but way over my head.
I didn't know about file::find, use constant, or the even
the value of including a prompting feature for the file
rename (duh!). So you've opened my eyes in a half dozen
ways (yes, there were other eye-openers in your script)--thanks.
I think for now I'm going to follow Michael Paoli's advice
and do it the hard way, which will help me learn scoping
and many other things. (Thanks, Michael! At first I balked
at doing the work, but now I see the value.) Anyway, working
with a looping sub is just about my speed right now.
And, yeah, I'm a little disturbed that I can't find a simple
command that queries a listing in a directory and tells
me (automatically) whether something is a file or a directory,
but maybe I'll write a loop for that, too.
Tonight just working on refining my search matching pattern
is making me happy. "s/%2f/_/" is not going to be enough,
since sometimes the "%" is followed by completely different
characters (other than "2f"); so my redraft is going to
be "s/%(\w){2}/_/" or "s/%\w\w/_/" or maybe even something
more elegant (hope, hope--have to test these). And of course
I'll be adding the "g" at the end for multiple instances.
Just the beginning, but fun!
Thanks, all.
--Sandy Santra
More information about the Oakland
mailing list