Dylan Vanderhoof wrote:
> 
> First question, is it possible to deep-copy a structure using TT?

Check Storable's dclone, or search CPAN for "clone". Or, use this for 
simple structures:

    # Anon copies of arrays/hashes
    # Based on deep_copy example by merlyn
    # http://www.stonehenge.com/merlyn/UnixReview/col30.html
    sub deep_copy {
        my $orig = shift;
        return (ref $orig eq 'HASH')
             ?  +{map { $_ => deep_copy($orig->{$_}) } keys %$orig}
             : (ref $orig eq 'ARRAY') ? [map deep_copy($_), @$orig]
             : $orig;
    }


You're right, this issue can be super annoying.

-Nate


_______________________________________________
List: [email protected]
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[email protected]/
Dev site: http://dev.catalyst.perl.org/

Reply via email to