-
-
15 Feb 2012 20:02:22 UTC
- Distribution: Thread-Task-Concurrent
- Module version: 0.01
- Source (raw)
- Browse (raw)
- Changes
- How to Contribute
- Issues
- Testers (2 / 24 / 0)
- Kwalitee
Bus factor: 1- License: perl_5
- Activity
24 month- Tools
- Download (7.49KB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
and 1 contributors- Joachim Bargsten <cpan at bargsten dot org>
- Dependencies
- unknown
- Reverse dependencies
- CPAN Testers List
- Dependency graph
NAME
Thread::Task::Concurrent::Util - utility functions for threads::shared
SYNOPSIS
use Thread::Task::Concurrent::Util qw(unshared_clone); $unshared_var = unshared_clone($shared_var);
DESCRIPTION
Thread::Task::Concurrent::Util provides utility functions for threads::shared.
SUBROUTINES
- unshared_clone REF
-
unshared_clone
takes a reference, and returns a UNshared version of its argument, performing a deep copy on any shared elements. Any unshared elements in the argument are used as is (i.e., they are not cloned).my $cpy = shared_clone({'foo' => [qw/foo bar baz/]}); my $unshared_cpy = unshared_clone($cpy);
Object status (i.e., the class an object is blessed into) is also cloned. my $obj = {'foo' => [qw/foo bar baz/]}; bless($obj, 'Foo'); my $cpy = shared_clone($obj);
my $unshared_cpy = unshared_clone($cpy);
This functionality comes in extremely handy for serialization purposes with e.g. YAML::XS. YAML::XS is not able to serialize shared variables with nested structures.
SEE ALSO
AUTHOR
jw bargsten,
<cpan at bargsten dot org>
ACKNOWLEDGEMENTS
Thanks to the authors of the module threads::shared form which the code was borrowed.
LICENSE
Thread::Task::Concurrent::Util is released under the same license as Perl.
Module Install Instructions
To install Thread::Task::Concurrent, copy and paste the appropriate command in to your terminal.
cpanm Thread::Task::Concurrent
perl -MCPAN -e shell install Thread::Task::Concurrent
For more information on module installation, please visit the detailed CPAN module installation guide.