#!/usr/local/bin/perl5.6.1 use File::Find; $header = "header.dat"; $footer = "footer.dat"; # for the convenience of &wanted calls, including -eval statements: use vars qw/*name *dir *prune/; *name = *File::Find::name; *dir = *File::Find::dir; *prune = *File::Find::prune; chomp($string = $ARGV[0]); #-- Print Header --------------------------------------------------------- print "Content-type: text/html\r\n"; print "\r\n"; open HEADER, $header or die "Can't open $header: $!\n"; while (
) { print; } close HEADER; # Traverse desired filesystems File::Find::find({wanted => \&wanted}, 'find', '.'); print scalar(@recipes); print "\n\n"; foreach $recipe(@recipes) { $. = 0; open R, $recipe or die "$!\n"; while () { chomp; if ($. == 1) { if (/$string/) { $recipe =~ s/^\.\///; s/^\s+//; if (!/^recipe\.cgi/) { push @titles, "$_|$recipe"; } } } } } @sorted_titles = sort { uc($a) cmp uc($b) } @titles; print "

", scalar(@sorted_titles), " salsa recipes and growing!\n"; print "

\n"; open FOOTER, $footer or die "Can't open $header: $!\n"; while (