any ['get', 'post'] => '/parsescript' => sub { template 'test.tt'; }; #### any ['get', 'post'] => '/parsescript' => sub { template 'test.tt'; my @filelist; my $rawtext; my $rootdir = 'C:\\Users\\Nathaniel\\Corpus\\'; opendir (DIR, $rootdir) or die $!; while (my $file = readdir(DIR) ) { next unless (-f "$rootdir/$file"); next unless ($file =~ /\.txt$/); push @filelist, $file ; } };