#!/usr/bin/perl -w $filename = "/chiserverhtml/arraydata/showers/cit/04/May.html"; $outputfile = "mayshowers.txt"; open MONTH, "<$filename" or die "Could not open $filename.\n$!\n"; open SHOWERLIST, ">$outputfile" or die "Could not open $outputfile. \n$!\n"; while () { unless ( /^\/ ) { next; } @words = split "\>"; $words[2] =~ s/^\s//gm; if ( $words[2] =~ /^shower/ ) { $textstring = substr $words[2], 7, 51; }else{ $textstring = substr $words[2], 0, 51; } # @words1 = split /\s/, $textstring; # @datewords = split /-/, $words1[0]; # # $m = $datewords[0]; # $d = $datewords[1]; # $y = $datewords[2]; @words1 = split /,/, $textstring; $nocommas = $words1[0]; print SHOWERLIST "$nocommas\n"; }