From lembark at wrkhors.com Wed Apr 4 14:43:56 2012 From: lembark at wrkhors.com (Steven Lembark) Date: Wed, 4 Apr 2012 21:43:56 +0000 Subject: [LA.pm] Classes with heterogeneous objects? In-Reply-To: <1331183689.72645.YahooMailNeo@web130203.mail.mud.yahoo.com> References: <4FB69414-8877-4CE0-90A0-E37A6FF6EDB9@arkadiy.com> <86k43e8r15.fsf@red.stonehenge.com> <1330744946.73849.YahooMailNeo@web130205.mail.mud.yahoo.com> <86ipimtgr2.fsf@red.stonehenge.com> <4F51ABD6.9060403@stemsystems.com> <1331183689.72645.YahooMailNeo@web130203.mail.mud.yahoo.com> Message-ID: <20120404214356.5287f44e.lembark@wrkhors.com> On Wed, 7 Mar 2012 21:14:49 -0800 (PST) Mike MacKenzie wrote: > > > You are right of course, ref wouldn't tell you > the underlying implementation type.__ However, > I think Randall is still correct -- ubiquitous > use of introspection code (aka navel gazing) > is a real downer.__ Encapsulating the type > determination code in a lookup table/method > somehow would help but you'd still have the > overhead__ -- actually more overhead > computationally. Simple fix: never use "ref" use "reftype" or "blessed" instead: use Scalar::Util qw( reftype ); given( reftype $object ) { when( 'HASH' ) { } ... } -- Steven Lembark 3646 Flora Pl Workhorse Computing St Louis, MO 63110 lembark at wrkhors.com +1 888 359 3508 From granny+lapm at gmail.com Mon Apr 16 12:16:17 2012 From: granny+lapm at gmail.com (Andrew Grangaard) Date: Mon, 16 Apr 2012 12:16:17 -0700 Subject: [LA.pm] Meetup of meetups -- this thursday at google Message-ID: Hi Mongers, We weren't included in the original announcement (obviously because we're not on meetup and not because we use semicolons ;) . Andrew FWD: | Hey everybody. Here is a message from Avesta from Coloft: | | Google Los Angeles and Coloft would like to invite you to a Meetup of Meetups on April 19th at 8pm! | | Join other local Los Angeles meetups for an informal gathering in the courtyard of Google's new facility in | Venice Beach for pizza and beer. The event will last from 8pm until 10pm, and there is no formal program | | This is an RSVP only event so please make sure to RSVP at http://goo.gl/hJ8Ob From johnnkirk at gmail.com Mon Apr 16 14:01:38 2012 From: johnnkirk at gmail.com (John Kirk) Date: Mon, 16 Apr 2012 14:01:38 -0700 Subject: [LA.pm] Meetup of meetups -- this thursday at google In-Reply-To: References: Message-ID: Hi all, I was too late, an hour and a half after this message went out. Oh well. regards, -- John Kirk (jnk at cpan.org) On Mon, Apr 16, 2012 at 12:16 PM, Andrew Grangaard wrote: > Hi Mongers, > We weren't included in the original announcement (obviously because > we're not on meetup and not because we use semicolons ;) . > Andrew > FWD: > | Hey everybody. Here is a message from Avesta from Coloft: > | Google Los Angeles and Coloft would like to invite you to a Meetup > | of Meetups on April 19th at 8pm! > | Join other local Los Angeles meetups for an informal gathering in > | the courtyard of Google's new facility in > | Venice Beach for pizza and beer. The event will last from 8pm until > | 10pm, and there is no formal program > | This is an RSVP only event so > | please make sure to RSVP at http://goo.gl/hJ8Ob From wdr1 at pobox.com Wed Apr 18 09:49:03 2012 From: wdr1 at pobox.com (William Reardon) Date: Wed, 18 Apr 2012 09:49:03 -0700 Subject: [LA.pm] Meetup of meetups -- this thursday at google In-Reply-To: References: Message-ID: Just seeing this now. If people are interested, hit me up off list. I can likely get a few people in, as personal guests if nothing else. I'm not sure how many, so please do so only if you think there's a good chance of you actually attending. -Bill On Mon, Apr 16, 2012 at 2:01 PM, John Kirk wrote: > Hi all, > > I was too late, an hour and a half after this message went out. Oh well. > > regards, -- John Kirk (jnk at cpan.org) > > > On Mon, Apr 16, 2012 at 12:16 PM, Andrew Grangaard > wrote: > > Hi Mongers, > > We weren't included in the original announcement (obviously because > > we're not on meetup and not because we use semicolons ;) . > > Andrew > > FWD: > > | Hey everybody. Here is a message from Avesta from Coloft: > > | Google Los Angeles and Coloft would like to invite you to a Meetup > > | of Meetups on April 19th at 8pm! > > | Join other local Los Angeles meetups for an informal gathering in > > | the courtyard of Google's new facility in > > | Venice Beach for pizza and beer. The event will last from 8pm until > > | 10pm, and there is no formal program > > | This is an RSVP only event so > > | please make sure to RSVP at http://goo.gl/hJ8Ob > _______________________________________________ > Losangeles-pm mailing list > Losangeles-pm at pm.org > http://mail.pm.org/mailman/listinfo/losangeles-pm > -------------- next part -------------- An HTML attachment was scrubbed... URL: From granny+lapm at gmail.com Tue Apr 24 13:48:31 2012 From: granny+lapm at gmail.com (Andrew Grangaard) Date: Tue, 24 Apr 2012 13:48:31 -0700 Subject: [LA.pm] YAPC.na sold out! Message-ID: They've sold all 400 tickets to YAPC.na: http://blog.yapcna.org/post/21728496092/yapc-na-sold-out Sounds like they are all full up, but you might still be able to register if you are done sitting on the fence. --Andrew From Peter at PSDT.com Tue Apr 24 16:20:22 2012 From: Peter at PSDT.com (Peter Scott) Date: Tue, 24 Apr 2012 16:20:22 -0700 Subject: [LA.pm] YAPC.na sold out! In-Reply-To: References: Message-ID: <4F973536.4080303@PSDT.com> On 4/24/2012 1:48 PM, Andrew Grangaard wrote: > They've sold all 400 tickets to YAPC.na: > > http://blog.yapcna.org/post/21728496092/yapc-na-sold-out > > Sounds like they are all full up, but you might still be able to > register if you are done sitting on the fence. > Update on the home page: "YAPC::NA 2012 is *NOT* sold out. The report I ran had some duplicate data in it. So we have about 30 tickets remaining. If you're one of those people who hasn't registered yet, then please do so before these tickets are gone for real. " -------------- next part -------------- An HTML attachment was scrubbed... URL: From btilly at gmail.com Mon Apr 30 18:47:20 2012 From: btilly at gmail.com (Ben Tilly) Date: Mon, 30 Apr 2012 18:47:20 -0700 Subject: [LA.pm] What to call a small module Message-ID: I have a small module, I just don't know what to call it. Does anyone have any suggestions? It just takes a hash, and expands it as a template, with the variables referring to other keys. It can even handle nested hashes. So you might pass it something like this: { user => 'btilly', project_root => '/home/[% user %]/foo', template_root => '[% project_root %]/app/view', escaped => '\[% watch_this %]', } and then get back: { user => 'btilly', project_root => '/home/btilly/foo', template_root => '/home/btilly/foo//app/view', escaped => '[% watch_this %]', } The use case is mostly for configuration files, where you'd have a hash describing a basic sandbox template, override the values you need to, and then get the configuration for a developer. With this sort of templating, the amount that you need to override goes way down. From marcoapalma at yahoo.com Mon Apr 30 19:10:37 2012 From: marcoapalma at yahoo.com (Marco Palma) Date: Mon, 30 Apr 2012 19:10:37 -0700 (PDT) Subject: [LA.pm] What to call a small module In-Reply-To: <1335838162.56220.YahooMailNeo@web112108.mail.gq1.yahoo.com> References: <1335838162.56220.YahooMailNeo@web112108.mail.gq1.yahoo.com> Message-ID: <1335838237.12354.YahooMailNeo@web112104.mail.gq1.yahoo.com> Sent this privately but I meant to spam... >________________________________ > From: Marco Palma >To: Ben Tilly >Sent: Monday, April 30, 2012 7:09 PM >Subject: Re: [LA.pm] What to call a small module > > >Hash::Tatertot > > >?? or > > > >Hash::TemplateTot > > > >Tater tots are very yummy.? They were the food I tolerated the longest at my college cafeteria. > > >http://en.wikipedia.org/wiki/Tater_Tots > > >And to paraphrase Miyagawa-san, cute names are easy to remember and Rock!!!: > > > >http://search.cpan.org/~miyagawa/Twiggy-0.1020/lib/Twiggy.pm#NAMING > > > > >>________________________________ >> From: Ben Tilly >>To: Los Angeles Perl Mongers >>Sent: Monday, April 30, 2012 6:47 PM >>Subject: [LA.pm] What to call a small module >> >>I have a small module, I just don't know what to call it.? Does anyone >>have any suggestions? >> >>It just takes a hash, and expands it as a template, with the variables >>referring to other keys.? It can even handle nested hashes.? So you >>might pass it something like this: >> >>? { >>? ? user => 'btilly', >>? ? project_root => '/home/[% user %]/foo', >>? ? template_root => '[% project_root %]/app/view', >>? ? escaped => '\[% watch_this %]', >>? } >> >>and then get back: >> >>? { >>? ? user => 'btilly', >>? ? project_root => '/home/btilly/foo', >>? ? template_root => '/home/btilly/foo//app/view', >>? ? escaped => '[% watch_this %]', >>? } >> >>The use case is mostly for configuration files, where you'd have a >>hash describing a basic sandbox template, override the values you need >>to, and then get the configuration for a developer.? With this sort of >>templating, the amount that you need to override goes way down. >>_______________________________________________ >>Losangeles-pm mailing list >>Losangeles-pm at pm.org >>http://mail.pm.org/mailman/listinfo/losangeles-pm >> >> >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From uri at stemsystems.com Mon Apr 30 20:54:06 2012 From: uri at stemsystems.com (Uri Guttman) Date: Mon, 30 Apr 2012 23:54:06 -0400 Subject: [LA.pm] What to call a small module In-Reply-To: References: Message-ID: <4F9F5E5E.4060900@stemsystems.com> On 04/30/2012 09:47 PM, Ben Tilly wrote: > I have a small module, I just don't know what to call it. Does anyone > have any suggestions? > > It just takes a hash, and expands it as a template, with the variables > referring to other keys. It can even handle nested hashes. So you > might pass it something like this: > > { > user => 'btilly', > project_root => '/home/[% user %]/foo', > template_root => '[% project_root %]/app/view', > escaped => '\[% watch_this %]', > } > > and then get back: > > { > user => 'btilly', > project_root => '/home/btilly/foo', > template_root => '/home/btilly/foo//app/view', > escaped => '[% watch_this %]', > } > > The use case is mostly for configuration files, where you'd have a > hash describing a basic sandbox template, override the values you need > to, and then get the configuration for a developer. With this sort of > templating, the amount that you need to override goes way down. couple of ideas: Template::HashValues Template::Config but why another template module? template::simple can do that with a simple values loop (untested): # add template paths or files here my $tmpl = Template::Simple->new() ; # $conf has the replacement values as a hash ref $_ = ${$tmpl->render( $_, $conf )} for values %config_hash ; uri From tony at metracom.com Mon Apr 30 21:01:03 2012 From: tony at metracom.com (Tony) Date: Mon, 30 Apr 2012 21:01:03 -0700 Subject: [LA.pm] What to call a small module In-Reply-To: <4F9F5E5E.4060900@stemsystems.com> References: <4F9F5E5E.4060900@stemsystems.com> Message-ID: <201204302101.03527.tony@metracom.com> My 2 cents. Template::HashExpand On Monday 30 April 2012 20:54:06 Uri Guttman wrote: > On 04/30/2012 09:47 PM, Ben Tilly wrote: > > I have a small module, I just don't know what to call it. Does anyone > > have any suggestions? > > > > It just takes a hash, and expands it as a template, with the variables > > referring to other keys. It can even handle nested hashes. So you > > > > might pass it something like this: > > { > > > > user => 'btilly', > > project_root => '/home/[% user %]/foo', > > template_root => '[% project_root %]/app/view', > > escaped => '\[% watch_this %]', > > > > } > > > > and then get back: > > { > > > > user => 'btilly', > > project_root => '/home/btilly/foo', > > template_root => '/home/btilly/foo//app/view', > > escaped => '[% watch_this %]', > > > > } > > > > The use case is mostly for configuration files, where you'd have a > > hash describing a basic sandbox template, override the values you need > > to, and then get the configuration for a developer. With this sort of > > templating, the amount that you need to override goes way down. > > couple of ideas: > > Template::HashValues > Template::Config > > but why another template module? template::simple can do that with a > simple values loop (untested): > > # add template paths or files here > my $tmpl = Template::Simple->new() ; > # $conf has the replacement values as a hash ref > $_ = ${$tmpl->render( $_, $conf )} for values %config_hash ; > > uri > _______________________________________________ > Losangeles-pm mailing list > Losangeles-pm at pm.org > http://mail.pm.org/mailman/listinfo/losangeles-pm From btilly at gmail.com Mon Apr 30 21:21:59 2012 From: btilly at gmail.com (Ben Tilly) Date: Mon, 30 Apr 2012 21:21:59 -0700 Subject: [LA.pm] What to call a small module In-Reply-To: <4F9F5E5E.4060900@stemsystems.com> References: <4F9F5E5E.4060900@stemsystems.com> Message-ID: On Mon, Apr 30, 2012 at 8:54 PM, Uri Guttman wrote: > On 04/30/2012 09:47 PM, Ben Tilly wrote: >> >> I have a small module, I just don't know what to call it. ?Does anyone >> have any suggestions? >> >> It just takes a hash, and expands it as a template, with the variables >> referring to other keys. ?It can even handle nested hashes. ?So you >> might pass it something like this: >> >> ? { >> ? ? user => ?'btilly', >> ? ? project_root => ?'/home/[% user %]/foo', >> ? ? template_root => ?'[% project_root %]/app/view', >> ? ? escaped => ?'\[% watch_this %]', >> ? } >> >> and then get back: >> >> ? { >> ? ? user => ?'btilly', >> ? ? project_root => ?'/home/btilly/foo', >> ? ? template_root => ?'/home/btilly/foo//app/view', >> ? ? escaped => ?'[% watch_this %]', >> ? } >> >> The use case is mostly for configuration files, where you'd have a >> hash describing a basic sandbox template, override the values you need >> to, and then get the configuration for a developer. ?With this sort of >> templating, the amount that you need to override goes way down. > > > couple of ideas: > > Template::HashValues > Template::Config > > but why another template module? template::simple can do that with a simple > values loop (untested): > > ? ? ? ?# add template paths or files here > ? ? ? ?my $tmpl = Template::Simple->new() ; > ? ? ? ?# $conf has the replacement values as a hash ref > ? ? ? ?$_ = ${$tmpl->render( $_, $conf )} for values %config_hash ; Your simple loop does not handle recursive replacement. In my simple example above, the user btilly got inserted into the project root and then that into the template root. If you just expanded everything over and over again until nothing looked like a template, that would kind of work. But what if you wanted to wind up with a piece of TT syntax, there is no way to do that. (I support an escape mechanism for that.) But it gets worse. The original use case for this code has to handle nested hashes as well. Let me illustrate. In a base config: $PARAM{prod} = { email_qa_email => undef, email_pager_email => 'some_pagers at appropriate_companies', # etc email => { qa_email => '[% email_qa_email %]', pager_email => '[% email_pager_email %]', # etc }, }; And then: $PARAM{sandbox} = { %{$PARAM{prod}}, default_email => '[% user %]@company.com', email_qa_email => 'QA <[% default_email %]>', email_pager_email => 'Pagers <[% default_email %]>', # etc. }; And then: $PARAM{some_user} => { %{$PARAM{sandbox}}, user => 'some_user', }; At this point $PARAM{some_user} contains: { user => 'some_user', default_email => '[% user %]@company.com', email_qa_email => 'QA <[% default_email %]>', email_pager_email => 'Pagers <[% default_email %]>', # etc email => { qa_email => '[% email_qa_email %]', pager_email => '[% email_pager_email %]', # etc }, } And after expansion will contain: { user => 'some_user', default_email => 'some_user at company.com', email_qa_email => 'QA ', email_pager_email => 'Pagers ', # etc email => { qa_email => 'QA ', pager_email => 'Pagers ', # etc }, } Note that the nested hash now contains the results of substitutions that have been expanded recursively 3 times. I looked for a wheel that looked like it would fit. I did not find one. So I coded a new one. (Currently 120 lines long. But I still need to add documentation, etc.) From mackenziemikebus at yahoo.com Mon Apr 30 23:10:59 2012 From: mackenziemikebus at yahoo.com (Mike MacKenzie) Date: Mon, 30 Apr 2012 23:10:59 -0700 (PDT) Subject: [LA.pm] What to call a small module In-Reply-To: <201204302101.03527.tony@metracom.com> References: <4F9F5E5E.4060900@stemsystems.com> <201204302101.03527.tony@metracom.com> Message-ID: <1335852659.25951.YahooMailNeo@web130202.mail.mud.yahoo.com> Here's my suggestions: Hash::TemplateValues? # boring, but explanatory Hash::Popcorn?? #? more fun... Hash::Splash??? #? ... but less explanatory Hash::Weavalues # ________________________________ From: Tony To: losangeles-pm at pm.org Sent: Monday, April 30, 2012 9:01 PM Subject: Re: [LA.pm] What to call a small module My 2 cents. Template::HashExpand On Monday 30 April 2012 20:54:06 Uri Guttman wrote: > On 04/30/2012 09:47 PM, Ben Tilly wrote: > > I have a small module, I just don't know what to call it.? Does anyone > > have any suggestions? > > > > It just takes a hash, and expands it as a template, with the variables > > referring to other keys.? It can even handle nested hashes.? So you > > > > might pass it something like this: > >? ? { > >? ? > >? ? ? user =>? 'btilly', > >? ? ? project_root =>? '/home/[% user %]/foo', > >? ? ? template_root =>? '[% project_root %]/app/view', > >? ? ? escaped =>? '\[% watch_this %]', > >? ? > >? ? } > > > > and then get back: > >? ? { > >? ? > >? ? ? user =>? 'btilly', > >? ? ? project_root =>? '/home/btilly/foo', > >? ? ? template_root =>? '/home/btilly/foo//app/view', > >? ? ? escaped =>? '[% watch_this %]', > >? ? > >? ? } > > > > The use case is mostly for configuration files, where you'd have a > > hash describing a basic sandbox template, override the values you need > > to, and then get the configuration for a developer.? With this sort of > > templating, the amount that you need to override goes way down. > > couple of ideas: > > Template::HashValues > Template::Config > > but why another template module? template::simple can do that with a > simple values loop (untested): > > ??? # add template paths or files here > ??? my $tmpl = Template::Simple->new() ; > ??? # $conf has the replacement values as a hash ref > ??? $_ = ${$tmpl->render( $_, $conf )} for values %config_hash ; > > uri > _______________________________________________ > Losangeles-pm mailing list > Losangeles-pm at pm.org > http://mail.pm.org/mailman/listinfo/losangeles-pm _______________________________________________ Losangeles-pm mailing list Losangeles-pm at pm.org http://mail.pm.org/mailman/listinfo/losangeles-pm -------------- next part -------------- An HTML attachment was scrubbed... URL: