#!/usr/bin/perl -w # # Recipe linking program # use strict; use CGI qw(:standard); use CGI::Carp qw(fatalsToBrowser); BEGIN { my $errorLog = "/home/mmtnsage/errors/rlink.log"; use CGI::Carp qw(carpout); open (LOG, ">> $errorLog") or die "Unable to append to $errorLog: $!\n"; carpout(*LOG); } BEGIN { unshift( @INC, "/home/mmtnsage/bin"); } use CGI::FastTemplate; use Tie::IxHash; # forward delcaration # sub LogHit; # from 'sys/file.ph': eval 'sub LOCK_EX {2;}'; eval 'sub LOCK_UN {8;}'; MAIN: { my $base_dir = "/home/mmtnsage/public_html/recipes/store/"; my $cat_base = "/catalog"; my $templateDir = "/home/mmtnsage/public_html/Templates"; my $recipeTemplate = "recipe.html"; my $filename = shift(@ARGV); my %ingredients; tie %ingredients, "Tie::IxHash"; %ingredients = ( "almond oil", "Almond Oil", "amber bottle", "Amber Bottle", "apple blossom", "Apple Blossom", "apricot, golden", "Golden Apricot", "golden apricot", "Golden Apricot", "apricot kernel oil", "Apricot Kernel Oil", "avocado oil", "Avocado Oil", "balsam peru", "Balsam Peru", "beeswax", "Beeswax", "bentonite", "Bentonite", "bluebonnet", "Bluebonnet", "cantaloupe", "Cantaloupe", "cinnamon leaf essential oil", "Cinnamon Leaf Essential Oil", "citric acid", "Citric Acid", "clove leaf essential oil", "Clove Leaf Essential Oil", "cocoa butter", "Cocoa Butter", "coconut oil", "Coconut Oil", "conversion calculator", "Conversion Calculator", "cucumber", "Cucumber", "dropper", "Dropper", "earl grey tea", "Earl Grey Tea", "emulsifying wax", "Emulsifying Wax", "fragrance oil", "Fragrance Oil", "frankincense", "Frankincense", "gardenia", "Gardenia", "germaben ii", "Germaben II", "glycerin", "Glycerin", "heather", "Heather", "heliotrope", "Heliotrope", "honey almond", "Honey Almond", "honeydew", "Honeydew", "hydrogenated soy", "Hydrogenated Soybean Oil", "intense almond", "Intense Almond", "jasmine", "Jasmine", "jojoba oil", "Jojoba Oil", "lavender 40/42", "Lavender 40/42", "lavender essential oil", "Lavender Essential Oil", "lanolin", "Lanolin", "lavender flowers", "Lavender Flowers", "lemon essential oil", "Lemon Essential Oil", "lemongrass essential oil", "Lemongrass Essential Oil", "lilac", "Lilac", "lily of the valley", "Lily Of The Valley", "lime essential oil", "Lime Essential Oil", "lip solutions", "Lip Solutions", "litsea cubeba essential oil", "Litsea Cubeba Essential Oil", "magnolia", "Magnolia", "mango butter", "Mango Butter", "mango sorbet", "Mango Sorbet", "myrrh", "Myrrh", "narcissus", "Narcissus", "orange oil", "Orange Oil", "orange essential oil", "Orange Essential Oil", "orient express", "Orient Express", "palm oil", "Palm Oil", "palm kernel oil", "Palm Kernel Oil", "patchouli", "Patchouly", "patchouly", "Patchouly", "peach", "Peach", " pear ", " Pear ", "peppermint essential oil", "Peppermint Essential Oil", "plumeria", "Plumeria", "rain orchid", "Rain Orchid", "raspberry", "Raspberry", " rose ", " Rose ", "roseberry", "Roseberry", "rosemary", "Rosemary", "sandalwood", "Sandalwood", "shea butter", "Shea Butter", "hydrogenated soybean oil", "Hydrogenated Soybean Oil", "shortening", "Hydrogenated Soybean Oil", "spearmint", "Spearmint", "spicy lime", "Spicy Lime", "stearic acid", "Stearic Acid", "strawberry", "Strawberry", "sweetgrass", "Sweetgrass", "sweet pea", "Sweet Pea", "tangerine essential oil", "Tangerine Essential Oil", "tea tree", "Tea Tree", "vanilla creme", "Vanilla Creme", "vanilla hazelnut", "Vanilla Hazelnut", "vanilla musk", "Vanilla Musk", "watermelon", "Watermelon", "wisteria", "Wisteria", "ylang ylang essential oil", "Ylang Ylang Essential Oil", "ylang-ylang essential oil", "Ylang Ylang Essential Oil", "essential oil", "Essential Oil", ); # LogHit($filename); # LogHit("Total"); open(RECIPE, "$base_dir$filename") || die "Couldn't open $base_dir$filename\n"; my $title; my $body = "