<html><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:12pt"><div><br><span></span></div><div><span>Sent this privately but I meant to spam...</span></div><div><br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; margin-top: 5px; padding-left: 5px;"> <div style="font-family: times new roman,new york,times,serif; font-size: 12pt;"> <div style="font-family: times new roman,new york,times,serif; font-size: 12pt;"> <div dir="ltr"> <font face="Arial" size="2"> <hr size="1"> <b><span style="font-weight: bold;">From:</span></b> Marco Palma <marcoapalma@yahoo.com><br> <b><span style="font-weight: bold;">To:</span></b> Ben Tilly <btilly@gmail.com> <br> <b><span style="font-weight: bold;">Sent:</span></b> Monday, April 30, 2012 7:09 PM<br> <b><span style="font-weight: bold;">Subject:</span></b> Re: [LA.pm] What to call a small module<br> </font> </div> <br>
<div id="yiv1089297638"><div><div style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); font-family: times new roman,new york,times,serif; font-size: 12pt;"><div><span>Hash::Tatertot</span></div><div><br><span></span></div><div><span> or <br></span></div><div><br><span></span></div><div><span>Hash::TemplateTot<br></span></div><div><br><span></span></div><div><span>Tater tots are very yummy. They were the food I tolerated the longest at my college cafeteria.</span></div><div><span><br></span></div><div>http://en.wikipedia.org/wiki/Tater_Tots</div><div><br></div><div>And to paraphrase Miyagawa-san, cute names are easy to remember and Rock!!!:<br></div><div><br></div><div>http://search.cpan.org/~miyagawa/Twiggy-0.1020/lib/Twiggy.pm#NAMING<br></div><div><br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; margin-top: 5px; padding-left: 5px;"> <div style="font-family: times new roman,new
york,times,serif; font-size: 12pt;"> <div style="font-family: times new roman,new york,times,serif; font-size: 12pt;"> <div dir="ltr"> <font face="Arial" size="2"> <hr size="1"> <b><span style="font-weight: bold;">From:</span></b> Ben Tilly <btilly@gmail.com><br> <b><span style="font-weight: bold;">To:</span></b> Los Angeles Perl Mongers <c> <br> <b><span style="font-weight: bold;">Sent:</span></b> Monday, April 30, 2012 6:47 PM<br> <b><span style="font-weight: bold;">Subject:</span></b> [<a target="_blank" href="http://LA.pm">LA.pm</a>] What to call a small module<br> </font> </div> <br>
I have a small module, I just don't know what to call it. Does anyone<br>have any suggestions?<br><br>It just takes a hash, and expands it as a template, with the variables<br>referring to other keys. It can even handle nested hashes. So you<br>might pass it something like this:<br><br> {<br> user => 'btilly',<br> project_root => '/home/[% user %]/foo',<br> template_root => '[% project_root %]/app/view',<br> escaped => '\[% watch_this %]',<br> }<br><br>and then get back:<br><br> {<br> user => 'btilly',<br> project_root => '/home/btilly/foo',<br> template_root => '/home/btilly/foo//app/view',<br> escaped => '[% watch_this %]',<br> }<br><br>The use case is mostly for configuration files, where you'd have a<br>hash describing a basic sandbox template, override the values you need<br>to, and
then get the configuration for a developer. With this sort of<br>templating, the amount that you need to override goes way down.<br>_______________________________________________<br>Losangeles-pm mailing list<br><a rel="nofollow" ymailto="mailto:Losangeles-pm@pm.org" target="_blank" href="mailto:Losangeles-pm@pm.org">Losangeles-pm@pm.org</a><br>http://mail.pm.org/mailman/listinfo/losangeles-pm<br><br><br> </div> </div> </blockquote></div> </div></div></div><br><br> </div> </div> </blockquote></div> </div></body></html>