#!/usr/bin/perl -w use strict; use Path::Resource; $rsc = Path::Resource->new(uri => "http://localhost/", dir => "/srv/www/htdocs"); opendir my $dirh, '/srv/www/htdocs/' or die $!; while( my $file = readdir $dirh ){ next unless $file =~ m/^\w+-\w+-\w+-\w+-\w+-\d\d\d\d\.pdf\z/; $rsc->child( $file ); print $rsc->file,"\n",$rsc->uri,"\n"; }