#!/usr/bin/perl -w ############################################################################### # Request URI Linker morbus@disobey.com # # Version 1.1 (2003-03-10) http://www.disobey.com/detergent/perl/ # ############################################################################### # A very simply script that creates links for each directory of the requested # # URI. We use this in conjunction with our index headers on Detergent. The # # most common use is via an SSI on an Apache webserver: # # # # # ############################################################################### use strict; print "Content-type: text/plain\n\n"; my @directories = split(/\//, $ENV{REQUEST_URI}); shift @directories; my $previous_link = "/"; foreach (@directories) { next if $_ =~ /\?/; # ignore queries. $previous_link = "$previous_link$_/"; print qq{/$_}; } print "/";