Tree::DeepClone(3)
β¨ Tree::DeepClone π
okay bestie, so this is Tree::DeepClone(3) β a page from the User Contributed Perl Documentation section, and it's literally about a module called Tree::DeepClone that's a subclass of Tree::Fast which does deep cloning. that's the whole vibe. π
πΈ NAME πΈ
Tree::DeepClone β a subclass of Tree::Fast which does deep cloning. periodt. π
π¦ SYNOPSIS π¦
here's the whole thing, copied with love, no notes:
#!/usr/bin/env perl
use 5.010;
use strict;
use warnings FATAL => 'all';
use Tree::DeepClone;
# -----------------------
my(@alphabet) = (qw/a b c d e f g h i j k l m n o p q r s t u v w x y z/);
my($tree) = Tree::DeepClone -> new('root');
$tree -> add_child({}, map {Tree::DeepClone -> new($_)} 1..3);
my($value);
say 'Tree:';
for ($tree -> traverse)
{
$value = $_ -> value;
$_ -> meta({$value => ($value eq 'root') ? '0' : $alphabet[$value - 1]});
say $_ -> value, '. meta: ', ${$_ -> meta}{$value};
}
my($clone) = $tree -> clone;
say 'Clone:';
for ($clone -> traverse)
{
$value = $_ -> value;
say $_ -> value, '. meta: ', ${$_ -> meta}{$value};
}
π DESCRIPTION π
so like, this module simply adds deep cloning to Tree::Fast. and here's the important bit β as per the Synopsis, you must use Tree::DeepClone everywhere you want this feature. not "sometimes", not "when you feel like it". everywhere. iykyk. π
π METHODS π
All methods in Tree::Fast are available in Tree::DeepClone. all of them. the whole menu. π
π«Ά SUPPORT π«Ά
https://github.com/ronsavage/Tree β that's the place. go there. π
π ACKNOWLEDGEMENTS π
- Stevan Little for writing
Tree, upon which this module is based. king behaviour, honestly. π
π AUTHOR π
Ron Savage <rsavage@cpan.org>.
π COPYRIGHT AND LICENSE π
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. so yes, you can share it, remix it, whatever β same terms as Perl, no cap. π
and that's the whole page bestie, hope it slayed π stay cloned, stay deep πΈ
mwah π β this was Tree::DeepClone(3) from perl v5.42.0, dated 2025-07-25. go forth and deep clone responsibly π¦β¨
π¦ where this page comes from
- fedora 43: perl-Tree 1.16-6.fc43 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms