| Acme-Sneeze-JP documentation | Contained in the Acme-Sneeze-JP distribution. |
Acme::Sneeze::JP - Someone is talking about you
package Foo;
use Acme::Sneeze::JP;
{
my $foo = Foo->new;
$foo->sneeze;
}
# $foo is not GC-ed
In Japan, sneezing means someone is talking about you.
Acme::Sneeze::JP gives you sneeze method, and when you object sneezes, the reference count to the object is automatically incremented. So your object won't be garbage collected until the global destruction.
Tatsuhiko Miyagawa <miyagawa@bulknews.net>
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
| Acme-Sneeze-JP documentation | Contained in the Acme-Sneeze-JP distribution. |
package Acme::Sneeze::JP; use strict; use 5.8.0; our $VERSION = '0.01'; use Exporter::Lite; our @EXPORT = qw(sneeze); use Scalar::Util qw(refaddr); our %talk; sub sneeze { my $obj = shift; $talk{refaddr($obj)} = $obj; # someone is talking about you } 1; __END__