URI-duri
view release on metacpan - search on metacpan
view release on metacpan or search on metacpan
lib/URI/_duri_tdb.pm view on Meta::CPAN
{ goto \&_new_from_string }
elsif (reftype $param eq 'HASH')
{ goto \&_new_from_hashref }
croak "cannot construct URI::duri object";
}
sub _new_from_string
{
my ($class, $str) = @_;
my $self = bless \$str => $class;
$self->_deconstruct;
return $self;
}
sub _new_from_hashref
{
my ($class, $hashref) = @_;
my $str = $class->_preferred_scheme . ':2001:urn:example:1';
my $self = bless \$str => $class;
if ($hashref->{datetime_string})
{ $self->datetime_string($self->{datetime_string}) }
elsif ($hashref->{datetime})
{ $self->datetime($self->{datetime}) }
else
{ $self->datetime(DateTime->now) }
exists $hashref->{embedded_uri}
or croak "need embedded_uri hash key";
view all matches for this distributionview release on metacpan - search on metacpan
( run in 1.275 second using v1.00-cache-2.02-grep-82fe00e-cpan-cec75d87357c )