|Welcome to the Monastery|
Re^5: Building a UNIX path from Irritating databy kyle (Abbot)
|on Nov 30, 2009 at 13:24 UTC||Need Help??|
I think the problem is that what you have still reads everything into @subfolders. Here's the snippet I'm talking about.
If you need @subfolders for some purpose outside the code we're talking about, you could still have it. Just declare my @subfolders; at the same scope as $parentid and %parents_of, without initializing it. Then, right inside the FFINFO read loop, push every $line in. It winds up looking like this:
You also had a question about this:
What this means is, "if @parents is non-empty, return first expression (with nested maps), else return the second expression ($folderid alone in an array reference)." Your description leads me to believe that you have the precedence mixed up. What you describe is this:
What's happening is this:
You can see this kind of thing yourself using B::Deparse. I ran this command line:
With the -p, it puts parentheses in to clarify how expressions are interpreted. As a result, it showed me this (along with all the other code):
That's not pretty, but it does show that the return is "outside" the whole rest of the line.
I hope this helps. I feel I've written in some haste, so I wouldn't be surprised if I've been unclear. If I have left you with any other questions, feel free to ask.