Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: store parent child relation

by turo (Friar)
on May 18, 2006 at 08:13 UTC ( [id://550181]=note: print w/replies, xml ) Need Help??


in reply to store parent child relation

I've made a wide exploration of the tree, without recursion, the result is akin the one you've shown on your post

#!/usr/bin/perl @ini_array = getarr("1"); @final_array = (1); while (@ini_array) { @aux = (); push @final_array, @ini_array; map { push @aux, getarr($_) } @ini_array; @ini_array = @aux; } sub getarr { $fl = shift; @sublist=(); open(A,"$fl.txt") or die "Can't open $fl.txt"; while (<A>) { chomp; push @sublist, $_; } close A; return @sublist; } print "final: @final_array\n";
hope that helps...

perl -Te 'print map { chr((ord)-((10,20,2,7)[$i++])) } split //,"turo"'

Replies are listed 'Best First'.
Re^2: store parent child relation
by Anonymous Monk on May 18, 2006 at 08:41 UTC
    turo,
    Thanks a lot for your help.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://550181]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (1)
As of 2024-04-25 04:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found