Re: Dynamic directory handles?
- From: Tad McClellan <tadmc@xxxxxxxxxxxxxx>
- Date: Thu, 22 Dec 2005 19:51:44 -0600
IanW <whoever@xxxxxxxxxxxxx> wrote:
> "Tad McClellan" <tadmc@xxxxxxxxxxxxxx> wrote in message
> news:slrndqlck1.71n.tadmc@xxxxxxxxxxxxxxxxxxxxxxx
>> 3) There is an already-invented (and tested) wheel for doing
>> recursive directory searching, the File::Find module.
>
> The only thing that sometimes puts me off using modules for relatively
> simple things like this, is that I wonder how much extra resources they use
> or whether they compromise performance in some way.
Cost to spend extra CPU cycles: $0.000001
Cost to develop code that saves those cycles: $1000.00
Your program will have to execute an awfully large number of
times for your approach to be economical.
Having a room full of programmers working on shaving off a few
cycles or bytes was commonplace in the '70s, but nowadays cycles
are cheap, RAM is cheap, what is expensive is your salary.
(though payday may make you argue that you are not expensive enough. :-)
> That is, File: Find must
> be quite a sizable module with a stack of function/options, so couldn't that
> mean lots more memory to run,
Does your application have to run on a cell phone or some other
place where RAM costs a premium?
> or is that an incorrect presumption?
It was correct 30 years ago, but it has changed due to Moore's Law.
>> If $fl is a symlink to a "higher" directory, then your
>> code will go into an infinite loop here.
>
> it's a script that will only run on my Windows servers, so that wasn't an
> issue
Windows does not have symbolic links?
> is there any particular reason you use
> single quotes there instead of double quotes?
Yes, I use single quotes unless I require one of the two extra
things (escapes and interpolation) that double quotes brings with it.
> I tend to use "" for pretty
> much everything.
Some strings contain variables, some strings don't.
During debugging, you are very often looking for variables.
You have to examine _every_ string, looking for variables.
I get to skip careful examination of many strings, because
they have been marked "no variables here" by the single quotes.
ie. it enables faster debugging.
> Also, I don't ever seem to use "||" - "or" would work as
> well in that scenario wouldn't it?
What happened when you tried it?
--
Tad McClellan SGML consulting
tadmc@xxxxxxxxxxxxxx Perl programming
Fort Worth, Texas
.
- References:
- Dynamic directory handles?
- From: IanW
- Re: Dynamic directory handles?
- From: Tad McClellan
- Re: Dynamic directory handles?
- From: IanW
- Dynamic directory handles?
- Prev by Date: Exiting without printing
- Next by Date: Re: How can I interpolate the RHS of a regex?
- Previous by thread: Re: Dynamic directory handles?
- Next by thread: Dave Roth's site (Win32::AdminMisc, Win32::ODBC, etc.) not available.
- Index(es):
Relevant Pages
|