my $start = $getdata; my $end = $getdata2; my $dir = '../weblog/'; @ARGV = (); die "start must be less than end" if $start >= $end; die "no dir $dir here" unless -d $dir; find sub { my $numb = (fileparse($_,'.txt'))[0]; return unless $numb =~ /^\d+$/; push @ARGV, $File::Find::name if $numb >= $start and $numb <= $end; }, $dir; die "no .txt files found in $dir" unless @ARGV; my %replace = ( iapw_p1 => "P1 = (search inquiry, launch page)\n", iapw_p2 => "P2 = (policy coverages, endorsements, operators)\n", iapw_p3 => "P3 = (policy notepad)\n", iapw_b1 => "B1 = (billing inquiry: auto, home and properties)", iapw_p0 => "P0 = (policy search)\n", iapw_c0 => "C0 = (record search)\n", iapw_c1 => "C1 = (record_two inquiry)\n", iapw_c3 => "C3 = (noted notepad)\n", iapw_h1 => "H1 = (owners and rental inquiry and history)\n"); while (<>) { foreach my $key ( keys %replace ) { s/$key/$replace{$key}/g ; } print; }