Clone
is much faster than Storable::dclone
, but the latter supports more data types.
Clone::Fast
and Clone::More
are pretty much equivalent if memory serves me right, but less feature complete than even Clone, and Scalar::Util::Clone
supports even less but IIRC is the fastest of them all for some structures.
With respect to readability these should all work the same, they are virtually interchangeable.
If you have no specific performance needs I would just use Storable's dclone.
I wouldn't use Data::Dumper
for this simply because it's so cumbersome and roundabout. It's probably going to be very slow too.
For what it's worth, if you ever want customizable cloning then Data::Visitor
provides hooking capabilities and fairly feature complete deep cloning is the default behavior.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…