threads::variables::reap::attr - reap variables in new threads by attribute
use threads::variables::reap::attr; # force database handle being reaped in each new thread my $dbh : reap = DBI->connect(...); # force array being emptied in each new thread my @connections : reap = map { DBI->connect( @{$_} ) } @dsnlist;
threads::variables::reap::attr provides an attribute reap by lexical scoping using Attribute::Lexical to mark variables to get reaped in new threads or child processes at compile time.
threads::variables::reap::attr
reap
Jens Rehsack, <rehsack at cpan.org>
<rehsack at cpan.org>
This module provides an attribute reap analogous to threads::shared provides the shared attribute. Entirely lower cased attribute names are reserved for future features, so a warning will occure when threads::variables::reap::attr is used. Attributes should be avoided where ever possible, so I decided it's not to bad if an additional warning occures. Use
shared
BEGIN { $^W = 0; }
if the warning bothers you.
Further you should recognize, that in perl before 5.9.4 the lexical state of attribute declarations is not available at runtime. See "BUGS" in Attribute::Lexical for details.
Please report any bugs or feature requests to bug-threads-variables-reap at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=threads-variables-reap. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
bug-threads-variables-reap at rt.cpan.org
You can find documentation for this module with the perldoc command.
perldoc threads::variables::reap::attr
You can also look for information at:
RT: CPAN's request tracker
http://rt.cpan.org/NoAuth/Bugs.html?Dist=threads-variables-reap
AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/threads-variables-reap
CPAN Ratings
http://cpanratings.perl.org/d/threads-variables-reap
Search CPAN
http://search.cpan.org/dist/threads-variables-reap/
Larry Wall for giving us Perl - all our modules provide on his work. David Golden for his great contribution about Perl and threads on PerlMonks (see http://www.perlmonks.org/?node_id=483162). Steffen Mueller for Attribute::Handlers and the helpful explanantion about attributes there. Andrew Main, Adam Kennedy and Joshua ben Jore helping me pointing my problem I'm going to solve with this module.
Copyright 2010 Jens Rehsack.
This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.
See http://dev.perl.org/licenses/ for more information.
To install threads::variables::reap::attr, copy and paste the appropriate command in to your terminal.
cpanm
cpanm threads::variables::reap::attr
CPAN shell
perl -MCPAN -e shell install threads::variables::reap::attr
For more information on module installation, please visit the detailed CPAN module installation guide.