| URI-crid documentation | Contained in the URI-crid distribution. |
URI::crid - URI scheme as defined in RFC 4078
Version 0.01
Allows you to break down and/or build up URIs of the scheme CRID (as used by the TV-Anytime standard to uniquely identify television and radio programmes.
use URI;
my $doctor_who = URI->new("crid://bbc.co.uk/b0074fly");
print "authority: " . $doctor_who->authority . $/;
print "data: " . $doctor_who->data . $/;
...
Returns (or sets) the unique identifier that this crid applies to. The author of a crid may decide for themselves what form this data takes, to best suit the application.
Ali Craigmile, <ali at hodgers.com>
Please report any bugs or feature requests to bug-uri-crid at rt.cpan.org, or through
the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=URI-crid. I will be notified, and then you'll
automatically be notified of progress on your bug as I make changes.
You can find documentation for this module with the perldoc command.
perldoc URI::crid
You can also look for information at:
Gisle Aas gaas@cpan.org for writing the base class URI.
Copyright 2007 Ali Craigmile, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
| URI-crid documentation | Contained in the URI-crid distribution. |
package URI::crid; require URI; our @ISA=qw(URI); use warnings; use strict; use URI::Escape qw(uri_unescape);
our $VERSION = '0.01';
sub authority { my $self = shift; my $old = $self->opaque; if (@_) { my $data = ($old =~ m|//[^/]+/(.*)$|)[0]; my $new = shift; $new = "" unless defined $new; $self->opaque("//$new/$data"); return $new; } $old = ($old =~ m|^//([^/]+)/?|)[0] || ''; return undef unless defined $old; return uri_unescape($old); }
sub data { my $self = shift; my $old = $self->opaque; if (@_) { my $tmp = $old; $tmp = "/" unless defined $tmp; my $authority = ($old =~ m|^//([^/]+)/?|)[0] || ''; my $new = shift; $new = "" unless defined $new; $self->opaque("//$authority/$new"); return $new; } $old = ($old =~ m|//[^/]+/(.*)$|)[0]; return uri_unescape($old); } 1;
1; # End of URI::crid