Re: Can recursion eliminate nested foreach() loops?

2012-02-26 Thread Steve Bertrand
On 2012-02-26 23:55, Rob Dixon wrote: On 27/02/2012 02:30, Steve Bertrand wrote: I know this isn't a beginner's question, but I know there are geniuses here. Is there a way to simplify this within Perl? Hi Steve Much of the complexity comes from working with the nested data structure. Writi

Re: Can recursion eliminate nested foreach() loops?

2012-02-26 Thread Rob Dixon
On 27/02/2012 02:30, Steve Bertrand wrote: I came across a question early this morning on a forum that intrigued me. I literally spent about five hours trying everything to solve it, but I couldn't. Every attempt at recursion, counting, numbering, hashing etc failed. Is there a way to use recurs

Re: Can recursion eliminate nested foreach() loops?

2012-02-26 Thread Steve Bertrand
On 2012-02-26 21:52, Shawn H Corey wrote: On 12-02-26 09:30 PM, Steve Bertrand wrote: I know this isn't a beginner's question, but I know there are geniuses here. Is there a way to simplify this within Perl? There is no simplify way of doing this. Separate off the first attribute and cross-pro

Re: Can recursion eliminate nested foreach() loops?

2012-02-26 Thread Steve Bertrand
On 2012-02-26 21:52, Shawn H Corey wrote: On 12-02-26 09:30 PM, Steve Bertrand wrote: I know this isn't a beginner's question, but I know there are geniuses here. Is there a way to simplify this within Perl? There is no simplify way of doing this. Separate off the first attribute and cross-pro

Re: Can recursion eliminate nested foreach() loops?

2012-02-26 Thread Shawn H Corey
On 12-02-26 09:30 PM, Steve Bertrand wrote: I know this isn't a beginner's question, but I know there are geniuses here. Is there a way to simplify this within Perl? There is no simplify way of doing this. Separate off the first attribute and cross-product it with a recursive call to the rest.

Can recursion eliminate nested foreach() loops?

2012-02-26 Thread Steve Bertrand
I came across a question early this morning on a forum that intrigued me. I literally spent about five hours trying everything to solve it, but I couldn't. Every attempt at recursion, counting, numbering, hashing etc failed. Is there a way to use recursion to eliminate the repeated and pre-ca

run command from perl

2012-02-26 Thread Manfred Lotz
Hi, I want to run a shell command with the following constraints: a. I like to get the return code of the command b. Furthermore I want to combine stdout and stderr so that the output comes in a natural sequence like in the shell. c. I don't want to capture the output in a variable (because the ou

Re: remove_tree question

2012-02-26 Thread Manfred Lotz
Hi Rob, On Sat, 25 Feb 2012 20:43:15 + Rob Dixon wrote: > On 25/02/2012 19:24, Manfred Lotz wrote: > > Hi all, > > I had a look at remove_tree from File::Path. > > > > Let us say I have a directory: ./a/b/c/d > > > > When I do > > > > remove_tree('./a', > > { > >verbose => 1 > >