in reply to Re^6: Out of memory.
in thread Out of memory.

Sorry for the clumsy description. I was trying to say that if want to do

some_statement for some_range while some_condition;
which is perfectly legal and very useful syntax in a couple of languages I have used--including various DEC Basics which I think is where the modifier forms of if, for while & until were borrowed from-- but illegal in perl, then using
map{ some_statement } some_range while some_condition;

is a useful substitute.

I take your point about map being conceptually different from a loop though, and I do try to avoid misusing it most of the time.

Thanks for the explaination on the traversal thing. I always forget about the special file types. I can see how that routine could disappear up it's own er...stack if it encountered a circular symlink.


Examine what is said, not who speaks.
"Efficiency is intelligent laziness." -David Dunham
"When I'm working on a problem, I never think about beauty. I think only how to solve the problem. But when I have finished, if the solution is not beautiful, I know it is wrong." -Richard Buckminster Fuller

Replies are listed 'Best First'.
Re^8: Out of memory.
by Aristotle (Chancellor) on Jul 23, 2003 at 23:10 UTC
    map{ some_statement } some_range while some_condition;
    You have a block there :), and the keyword goes in front too - might just as well do
    do { some_statement for some_range } while some_condition;

    At least, that's me.

    As far as the symlink is concerned, it's as easy as ln -s . foo (for which there actually are legitimate uses every once in a blue moon - I've used it). There are also a million other scenarious that require to decide on an individual basis whether a symlink is to be followed or not.

    Another thing I just remembered is AFS (Andrew File System) - a hugely useful truly distributed filesystem, which, to work as it does, has the unfortunate consequence that even absolute paths can mean different things under different conditions.

    If you fiddle long enough, you can come up with some pretty far out pathological cases on Unix. File::Find will handle them correctly - modulo what few bugs may be left, of course, but that's the advantage of having code reused and retested millions of times.

    Makeshifts last the longest.