#!/usr/bin/perl -w # Stolen from Blosxom Plugin: breadcrumbs #< create breadcrumbs link to a given page. # # Expects full path to document being displayed, # including document root. Relative path will assume # starting point at the document root. use strict; use Cwd; # What divider should I use between path components? # my $divider = " :: "; my $divider = " ->\n"; # Other variables. my ($path, $p, @p); my $docroot = '/doc/wn/htdocs'; # document root. my $altroot = '/space/wn/htdocs'; # if document root is a symlink. # Accept an argument, or use the current directory. # Strip the document root if it's there. $_ = shift || getcwd(); s!^$docroot/!! if m!^/!; s!^$altroot/!! if m!^/!; # Get started, then walk the path. push @p, 'Home'; $path = $_; foreach (split /\//, $path) { $p .= "/$_"; push @p, qq{$_}; } $_ = join $divider, @p; print "$_\n"; exit(0);