#!/usr/bin/perl -w use strict; sub go{ my $temp; my %DB; my $hist; my $tab= "    "; my $head; my $c=0; my ($r) = shift @_; open (F,$r) || die "Couldnt open $! $r"; $r =~ s/\./1\./; #@Data = ; my $store = ""; while (){ if (/.*/ && ! /Last modified/){ #If line is a title $temp = $_; $_=~ s/(<[^<>]+>)+//g; chomp; if (/\(/){ $store = $_; $store =~ s/[\(\)]//g; $DB{$store} = $temp; }else{ $store = $_; $store =~ s/[\(\)]//g; $DB{$store} = $temp; } }else{ #Not a title ($store ne "")? $DB{$store}:$head .= $_; } } print "writing $r"; open (N, ">$r")||die "Can't open to write"; print N "$head";$hist = "---"; foreach (sort keys %DB){ if ((/^$hist[s:]* /)){ $DB{$_} =~ s/<\/*B>/$tab/; $DB{$_} =~ s/
/
$tab/; print N "$DB{$_}"; }else{ $hist = $_; print N $DB{$_}; } } } my @t; my @DIR; my $d; opendir (D,".") || die "Could not open directory! Check to make sure this file is in the right place. $!"; @DIR = readdir (D); print "Please select a file to modify\n"; $d=0; foreach (@DIR){ if (/keyword.\.html/){push @t, $_;print ++$d.". $_\n";} ; } print "Selection: "; $a = <>; go $t[$a-1] || die "Invalid Number! Try something within below $#t GOSH!!!";