SYNOPSIS

   package MyNiftyMap;

     use TM;
     use base qw(TM);
     use Class::Trait ('TM::ResourceAble');

     1;

   my $tm = new MyNiftyMap;
   $tm->url ('http://nirvana/');

   warn $tm->mtime;

   # or at runtime even:

   use TM;
   Class::Trait->apply ('TM', qw(TM::ResourceAble));
   my $tm = new TM;
   warn $tm->mtime;

DESCRIPTION

This traits adds methods to provide the role resource to a map. That allows a map to be associated with a resource which is addressed by a \s-1URL\s0 (actually a \s-1URI\s0 for that matter).

Predefined URIs

The following resources, actually their URIs are predefined: Symbolizes the \s-1UNIX\s0 \s-1STDIN\s0 file descriptor. The resource is all text content coming from this file. Symbolizes the \s-1UNIX\s0 \s-1STDOUT\s0 file descriptor. Symbolizes a resource which never delivers any content and which can consume any content silently (like \*(C`/dev/null\*(C' under \s-1UNIX\s0).

Predefined \s-1URI\s0 Methods

An inlined resource is a resource which contains all content as part of the \s-1URI\s0. Currently the \s-1TM\s0 content is to be written in AsTMa=. Example: inlined:donald (duck)

INTERFACE

Methods

url

$url = $tm->url $tm->url ($url) Once an object of this class is instantiated it keeps the \s-1URL\s0 of the resource to which it is associated. With this method you can retrieve and set that. No special further action is taken otherwise.

mtime

$time = $tm->mtime This function returns the \s-1UNIX\s0 time when the resource has been modified last. 0 is returned if the result cannot be determined. All methods from \s-1LWP\s0 are supported. Special resources are treated as follows:

always has mtime 0 always has an mtime 1 second in the future. The idea is that \s-1STDIN\s0 always has new content. always has mtime 0. The idea is that \s-1STDOUT\s0 never changes by itself.

RELATED TO TM::ResourceAble…

\s-1TM\s0

AUTHOR INFORMATION

Copyright 200[67], Robert Barta <[email protected]>, All rights reserved.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. http://www.perl.com/perl/misc/Artistic.html