Text::Tree man page on Fedora

Man page or keyword search:  
man Server   31170 pages
apropos Keyword Search (all sections)
Output format
Fedora logo
[printable version]

Text::Tree(3)	      User Contributed Perl Documentation	 Text::Tree(3)

NAME
       Text::Tree - format a simple tree of strings into a textual tree graph

SYNOPSIS
	   use Text::Tree;

	   my $tree = new Text::Tree( "root",
				      [ "left\nnode" ],
				      [ "right", [ "1" ], [ "2" ] ] );
	   print $tree->layout("boxed");

	   __OUTPUT__

	       +----+
	       |root|
	       +----+
	     .---^---.
	   +----+ +-----+
	   |left| |right|
	   |node| +-----+
	   +----+  .-^-.
		  +-+ +-+
		  |1| |2|
		  +-+ +-+

METHODS
   new()
	   my $tree = new Text::Tree( "label",
				      [ "left child label", [ ... ] ],
				      [ "right child label", [ ... ] );

       Create a new tree object from a nested set of array references.	The
       first element of each array must be a string used as a node label.  The
       remaining elements must each be an array reference for a child of the
       node.  Labels may contain newlines to support multiple lines of text.

   layout()
	   my @lines = $tree->layout( "centered in boxes" );
	   print @lines;

       Lays out the tree into an array of newline-terminated strings, ready
       for printing or displaying.  The optional style argument may contain
       various keywords such as 'center', 'box', 'line', 'oval' and/or
       'space'.	 These style keywords affect how the tree nodes are formatted.

DESCRIPTION
       Allows the caller to develop a tree structure, using nested arrays of
       strings and references.	Once developed, the whole tree can be printed
       as a diagram, with the root of the tree at the top, and child nodes
       formatted horizontally below them.

       The string labels are printed as-is, or optionally surrounded with a
       simple outlining style using printable ASCII characters.

       This module may be used with object-oriented or simple function calls.

HISTORY
       Mark Jason Dominus (aka MJD) asked for this functionality on his
       Expert-level "Perl Quiz of the Week" Number 5.  You can find out more
       about the QOTW discussion forum at http://perl.plover.com/qotw/

       The central formatting routine was submitted by Ron Isaacson to the
       Quiz forum as one possible solution to the general problem.

       Ed Halley adapted the Ron Isaacson entry (with permission), to correct
       some tree structures not originally handled, and to allow more
       formatting options for the box styles.

COPYRIGHT AND LICENSE
       Copyright 2003-2004 by Ron Isaacson

       Portions Copyright 2003 by Mark Jason Dominus

       Portions Copyright 2004 by Ed Halley

       This library is free software; you can redistribute it and/or modify it
       under the same terms as Perl itself.

perl v5.14.0			  2004-05-28			 Text::Tree(3)
[top]

List of man pages available for Fedora

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net