JSAN::URI - A JavaScript Archive Network (JSAN) Validating Mirror URI


  my $url = '';
  # Create the mirror handle
  my $mirror = JSAN::URI->new( $url );
  # Check the mirror
  if ( ! $mirror->valid ) {
        die "The mirror does not exist";
  if ( $mirror->age > (3600 * 48) ) {
        die "The mirror is too old";


The JavaScript Archive Network (JSAN) uses a mirror synchronisation method originally invented for the Comprehensive Perl Archive Network (CPAN) which involved created a tiny specially named file in the root of the filesystem that contains a timestamp, updated whenever the index is regenerated.

By retrieving and examining this file, it is possible to validate if a given URL actually represents a JSAN mirror, and how up to date that mirror is, compared to the master site.

This module implements the logic required to do this in a reusable form


new $uri

The new constructor takes a path to the base of a JSAN mirror and creates a handle object for it.

Returns a JSAN::URI object, or undef if not passed a valid url path.


The URI accessor returns a URI object for the location of the mirror.


The uri accessor returns a string of the location of the mirror.


The valid method check to see if the mirror exists, that is has the mirror.conf file, and that matches the expected content.

Returns true if the mirror is valid, or false otherwise.


- Add verbose support

- Finish this when the mirrors have mirror.conf files


Bugs should be reported via the CPAN bug tracker at

For other issues, contact the author.


Adam Kennedy <>,


Copyright 2005 Adam Kennedy. All rights reserved.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

The full text of the license can be found in the LICENSE file included with this module.