Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re^2: reparse tree in textfile

by ikegami (Patriarch)
on Feb 20, 2010 at 06:29 UTC ( #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? | Other CB clients
Other Users?
Others romping around the Monastery: (2)
As of 2023-09-30 21:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?