# Let's try to make our URL subclass { package MyURL; @ISA = URI::URL::implementor();
sub _parse {
my($self, $init) = @_;
$self->URI::URL::_generic::_parse($init, qw(netloc path));
}
sub foo {
my $self = shift;
print ref($self)."->foo called for $self\n";
}
}
# Let's say that it implements the 'x-a+b.c' scheme (alias 'x-foo')
URI::URL::implementor('x-a+b.c', 'MyURL');
URI::URL::implementor('x-foo', 'MyURL');
# Now we are ready to try our new URL scheme $url = new URI::URL 'x-a+b.c://foo/bar;a?b'; $url->_expect('as_string', 'x-a+b.c://foo/bar;a?b'); $url->_expect('path', '/bar;a?b'); $url->foo; $newurl = new URI::URL 'xxx', $url; $newurl->foo; $url = new URI::URL 'yyy', 'x-foo:'; $url->foo;
1 POD Error
The following errors were encountered while parsing the POD:
- Around line 76:
Unknown directive: =comment