Bio-MUST-Core
view release on metacpan or search on metacpan
lib/Bio/MUST/Core/SeqId.pm view on Meta::CPAN
1382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848
# TODO: check if this optimized way always work for us
my
$key
=
$args
{full_id};
# return the existing instance
return
$instance_for
{
$key
}
if
defined
$instance_for
{
$key
};
# create a new instance
my
$instance
=
$class
->new(
%args
);
$instance_for
{
$key
} =
$instance
;
# Note: do not weaken reference or this will defeat the purpose.
# However, this could lead to memory leak in some extreme cases.
# Scalar::Util::weaken $instance_for{$key};
return
$instance
;
}
# class methods to build modern MUST-compliant id from NCBI components
sub
new_with {
## no critic (RequireArgUnpacking)
my
$class
=
shift
;
( run in 2.467 seconds using v1.01-cache-2.11-cpan-a9ef4e587e4 )