#!/usr/bin/perl -l $| = 1; my $TWIKI= '/home/rnapier/public_html/twiki'; opendir( SCRIPTS, "$TWIKI/bin" ); my %SCRIPT = map{ lc($_) => "/twiki/bin/$_" } readdir SCRIPTS; closedir SCRIPTS; opendir( WEBS, "$TWIKI/data" ); my %WEB = map { lc($_) => $_ } readdir WEBS; closedir WEBS; ENTRY: while( ) { chomp; my( $null, $script, $web, $topic ) = split '/', $_, 4; if( -e "/home/rnapier/public_html/$script" ) { print; next } if( exists $SCRIPT{ $script } ) { $script = $SCRIPT{ $script }; } else { $topic = $web; $web = $script; $script = $SCRIPT{ viewauth }; } if( exists $WEB{ lc($web) } ) { $web = $WEB{ lc($web) }; if( $topic ) { opendir( TOPICS, "$TWIKI/data/$web" ); foreach my $file ( readdir TOPICS ) { $file =~ s/\.txt$//; if( lc($file) eq lc($topic)) { print join( '/', $script, $web, $file); closedir TOPICS; next ENTRY; } } closedir TOPICS; print join( '/', $script, $web, $topic); next; } else { print join( '/', $script, $web ); next; } } else { print; } }