Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re^2: reparse tree in textfile

by ikegami (Patriarch)
on Feb 20, 2010 at 06:29 UTC ( [id://824322]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my @path = '.';
    while (<DATA>) {
    ...
        $path[-1] = $node;
        print $prefix, join("/" => @path), "\n";
    }
    
  2. or download this
    my @path = '.';
    while (<DATA>) {
    ...
        splice @path, length($prefix)/2-1, 0+@path, $node;
        print $prefix, join("/" => @path), "\n";
    }
    
  3. or download this
    my @path = '.';
    while (<DATA>) {
    ...
        $path[-1] = $node;
        print $prefix, join("/" => @path), "\n";
    }
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (5)
As of 2024-04-25 10:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found