Posts

Showing posts from August, 2009

And Now For Some Really Basic Perl - JSON Manipulation

And Now For Some Really Basic Perl - JSON Manipulation In PerlWorld, there are basically two ways of doing virtually anything. a) Do it yourself b) Go look at CPAN and realize that Someone Has Done It Better Being a card-carrying member of approach (b) above, here's a remarkably simple way of mainpulating JSON in PerlWorld First, for some code based on Marc Lehmann's truly excellent JSON module # Include the JSON module use JSON::XS; # Create a thing (called $json) that will be used to encode JSON strings $json = JSON::XS->new(); # Make sure that the resultant JSON will print out all nice and pretty $json->pretty(1); # Create a basic JSON hash $jsonStructure->{id} = "1234"; $jsonStructure->{method} = "ReallyCoolMethod"; $jsonStructure->{version} = "1.0.1"; # $prettyJSON will contain the text string which is the Oh-So-Pretty version of $jsonStructure $prettyJson = $json->encode($jsonStructure); If you printed out the contents of $

ChatniPudi - The Universal Condiment

Image
ChatniPudi - aka " The Universal Condiment" 250 gms split Chana Dal 250 gms split Urad Dal 50 gms Red Chillies 50 gms Dried Tamarind from Block 2 cups Dried Coconut Flakes 1/2" side cube of Block Asafoetida , broken into two chunks Vegetable/sunflower oil as needed in recipe Break the tamarind into small strips or chunks. While doing so, pick out the seeds in the tamarind. Heat up an oven (or a toaster oven), to 250F , and - placing the tamarind on some foil, roast it till it turns slightly crisp. You don't want it to char (or start smoking!), just lose most of its internal liquid. The amount of time it'll take totally depends on the water content of the tamarind. Set a large (12"?) skillet on medium heat, add 1tbsp oil ,  Chana Dal , one chunk of asafoetida and half the Red Chillies . Roast whilst stirring frequently till chana dal till turns a fairly deep shade of brown. Not black. Brown. Black bad. Brown good. And yes, this is