From jay.hannah at iinteractive.com Wed Oct 2 15:35:34 2013 From: jay.hannah at iinteractive.com (Jay Hannah) Date: Wed, 2 Oct 2013 17:35:34 -0500 Subject: [Omaha.pm] Tue Oct 8 meeting Message-ID: <61D52159-3809-4957-864B-73230CD94AC2@iinteractive.com> It's almost that time again! Anyone have thing(s) they want to present? I could present "Modern Perl web development" if anyone's interested. (Or anything perl5, really.) Any interest in the p5-mop-redux? I could "learn" and present that. :) Cheers, Jay Hannah Project Lead / Programmer http://www.iinteractive.com Email: jay.hannah at iinteractive.com AOL IM: deafferret Mobile: 1.402.598.7782 Fax: 1.402.691.9496 From jay.hannah at iinteractive.com Wed Oct 2 15:38:25 2013 From: jay.hannah at iinteractive.com (Jay Hannah) Date: Wed, 2 Oct 2013 17:38:25 -0500 Subject: [Omaha.pm] Tue Oct 8 meeting In-Reply-To: <61D52159-3809-4957-864B-73230CD94AC2@iinteractive.com> References: <61D52159-3809-4957-864B-73230CD94AC2@iinteractive.com> Message-ID: On Oct 2, 2013, at 5:35 PM, Jay Hannah wrote: > Any interest in the p5-mop-redux? I could "learn" and present that. :) Heck, I could probably have my boss, Stevan Little, present it over Skype. It's his baby. He's a Perl rock star. SO FAMOUS!! :) https://github.com/stevan Cheers, Jay Hannah Project Lead / Programmer http://www.iinteractive.com Email: jay.hannah at iinteractive.com AOL IM: deafferret Mobile: 1.402.598.7782 Fax: 1.402.691.9496 From jay at jays.net Mon Oct 7 09:44:54 2013 From: jay at jays.net (Jay Hannah) Date: Mon, 7 Oct 2013 11:44:54 -0500 Subject: [Omaha.pm] Tue Oct 8 meeting: Modern Perl web development In-Reply-To: References: <61D52159-3809-4957-864B-73230CD94AC2@iinteractive.com> Message-ID: <601C5E15-2336-4973-9DB3-AE89BD475630@jays.net> OK, looks like it's me then: http://omacode.org Tuesday, Oct 8 2013 7pm Jay Hannah - Modern Perl web development: A whirlwind tour of MVC best practices, the DBIx::Class ORM, the Catalyst web framework, and the Template Toolkit. http://omacode.org See you there! :) Can a key holder confirm that they'll be there? Thanks, j From davidknaack at gmail.com Mon Oct 7 09:53:16 2013 From: davidknaack at gmail.com (David Knaack) Date: Mon, 7 Oct 2013 11:53:16 -0500 Subject: [Omaha.pm] [OMG!Code] Re: Tue Oct 8 meeting: Modern Perl web development In-Reply-To: <601C5E15-2336-4973-9DB3-AE89BD475630@jays.net> References: <61D52159-3809-4957-864B-73230CD94AC2@iinteractive.com> <601C5E15-2336-4973-9DB3-AE89BD475630@jays.net> Message-ID: Cool, looking forward to it. I'll make sure the doors are open before 7, but I probably won't be there before 6. On Mon, Oct 7, 2013 at 11:44 AM, Jay Hannah wrote: > OK, looks like it's me then: > > http://omacode.org > > Tuesday, Oct 8 2013 7pm > Jay Hannah - Modern Perl web development: A whirlwind tour of MVC best > practices, the DBIx::Class ORM, the Catalyst web framework, and the > Template Toolkit. > > http://omacode.org > > See you there! :) > > Can a key holder confirm that they'll be there? > > Thanks, > > j > > > > > -- > OMG!Code http://code.omahamakergroup.org > --- > You received this message because you are subscribed to the Google Groups > "OMG!Code" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to omg-code+unsubscribe at googlegroups.com. > Visit this group at http://groups.google.com/group/omg-code. > For more options, visit https://groups.google.com/groups/opt_out. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jay.hannah at iinteractive.com Wed Oct 9 08:11:46 2013 From: jay.hannah at iinteractive.com (Jay Hannah) Date: Wed, 9 Oct 2013 10:11:46 -0500 Subject: [Omaha.pm] Meetings Message-ID: <0AE407BF-EAFC-4D95-873F-0049C41C34F1@iinteractive.com> Thanks everybody for coming out last night! I thought it was a great forum, hopefully you found it useful. :) Here's the meat of the demo: https://github.com/iinteractive/MyApp I'll add the MVC.pdf that we spent most of our time on. The demo is unfinished -- if anyone finds the problems and wants spoilers I'd be happy to fix 'em. :) --- Any volunteers / requests for our next meeting? Tue Nov 5. http://omacode.org Thanks, Jay Hannah Project Lead / Programmer http://www.iinteractive.com Email: jay.hannah at iinteractive.com AOL IM: deafferret Mobile: 1.402.598.7782 Fax: 1.402.691.9496 From jay.hannah at iinteractive.com Wed Oct 9 08:16:08 2013 From: jay.hannah at iinteractive.com (Jay Hannah) Date: Wed, 9 Oct 2013 10:16:08 -0500 Subject: [Omaha.pm] Meetings In-Reply-To: <0AE407BF-EAFC-4D95-873F-0049C41C34F1@iinteractive.com> References: <0AE407BF-EAFC-4D95-873F-0049C41C34F1@iinteractive.com> Message-ID: <5DC0A5D6-992D-4561-BB9C-92C4D3C72FDF@iinteractive.com> On Oct 9, 2013, at 10:11 AM, Jay Hannah wrote: > Any volunteers / requests for our next meeting? Tue Nov 5. > > http://omacode.org I'd be interested in demos / discussions of logic-less templating engines. Mustache / Handlebars / other? Anyone into any of those and want to demo? http://mustache.github.io/ http://handlebarsjs.com/ Thanks, Jay Hannah Project Lead / Programmer http://www.iinteractive.com Email: jay.hannah at iinteractive.com AOL IM: deafferret Mobile: 1.402.598.7782 Fax: 1.402.691.9496 From Payne at MattPayne.org Wed Oct 9 08:44:35 2013 From: Payne at MattPayne.org (Matt Payne) Date: Wed, 9 Oct 2013 10:44:35 -0500 Subject: [Omaha.pm] [OMG!Code] Re: Meetings In-Reply-To: <5DC0A5D6-992D-4561-BB9C-92C4D3C72FDF@iinteractive.com> References: <0AE407BF-EAFC-4D95-873F-0049C41C34F1@iinteractive.com> <5DC0A5D6-992D-4561-BB9C-92C4D3C72FDF@iinteractive.com> Message-ID: Are meetings the second Tuesday of the month these days? I would like to plan on starting to attend and present. Knowing the meeting frequency helps me plan for things.... Thanks! --Matt Payne On Wed, Oct 9, 2013 at 10:16 AM, Jay Hannah wrote: > On Oct 9, 2013, at 10:11 AM, Jay Hannah > wrote: > > Any volunteers / requests for our next meeting? Tue Nov 5. > > > > http://omacode.org > > > I'd be interested in demos / discussions of logic-less templating engines. > Mustache / Handlebars / other? Anyone into any of those and want to demo? > > http://mustache.github.io/ > http://handlebarsjs.com/ > > Thanks, > > Jay Hannah > Project Lead / Programmer > http://www.iinteractive.com > Email: jay.hannah at iinteractive.com > AOL IM: deafferret > Mobile: 1.402.598.7782 > Fax: 1.402.691.9496 > > > > > > -- > OMG!Code http://code.omahamakergroup.org > --- > You received this message because you are subscribed to the Google Groups > "OMG!Code" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to omg-code+unsubscribe at googlegroups.com. > Visit this group at http://groups.google.com/group/omg-code. > For more options, visit https://groups.google.com/groups/opt_out. > -- "To go faster, slow down. Everybody who knows about orbital mechanics understands that." -- Scott Cherf as quoted at http://www.multicians.org/thvv/proverbs.html -------------- next part -------------- An HTML attachment was scrubbed... URL: From jay.hannah at iinteractive.com Wed Oct 9 09:01:21 2013 From: jay.hannah at iinteractive.com (Jay Hannah) Date: Wed, 9 Oct 2013 11:01:21 -0500 Subject: [Omaha.pm] [OMG!Code] Tue Oct 8 meeting In-Reply-To: References: <61D52159-3809-4957-864B-73230CD94AC2@iinteractive.com> Message-ID: <9B1401A8-38BB-4AE7-B46D-C5ED16FD1166@iinteractive.com> On Oct 2, 2013, at 6:00 PM, Jay Bendon wrote: > i'm interested in the presentation and summary of this presentation since my team does a lot of perl at amazon and its absurdly painful to develop in perl compared to python. Lol. Hi Jay, I'm bummed that you couldn't make it out to the meeting last night. I'm really interested in the Python vs. Perl phenomenon as you experience it at Amazon. I didn't know Amazon was in Omaha, using Perl. I'd love to hear a lot more about that. :) Last night a big chunk of my presentation was about how awful Perl can be. And how great Perl can be. I'm sure there's great and awful Python code out there too. Seems to me great and awful is possible in every language. Anyway, I'd love to hear anything you could share. I'd love to help fix your Perl stuff. :) Thanks, Jay Hannah Project Lead / Programmer http://www.iinteractive.com Email: jay.hannah at iinteractive.com AOL IM: deafferret Mobile: 1.402.598.7782 Fax: 1.402.691.9496 From jay at jays.net Wed Oct 9 09:06:43 2013 From: jay at jays.net (Jay Hannah) Date: Wed, 9 Oct 2013 11:06:43 -0500 Subject: [Omaha.pm] [OMG!Code] Re: Meetings In-Reply-To: References: <0AE407BF-EAFC-4D95-873F-0049C41C34F1@iinteractive.com> <5DC0A5D6-992D-4561-BB9C-92C4D3C72FDF@iinteractive.com> Message-ID: <716BFA9E-9D87-4A46-83DE-FE2CC7D2C0CA@jays.net> On Oct 9, 2013, at 10:44 AM, Matt Payne wrote: > Are meetings the second Tuesday of the month these days? I would like to plan on starting to attend and present. Knowing the meeting frequency helps me plan for things.... Thanks! --Matt Payne The OMG!Code meetings are every 4 weeks. On our homepage (http://omacode.org) there's a link to the OMG Google calendar. Look for the OMG!Code events. HTH, j From jay.hannah at iinteractive.com Thu Oct 10 13:39:47 2013 From: jay.hannah at iinteractive.com (Jay Hannah) Date: Thu, 10 Oct 2013 15:39:47 -0500 Subject: [Omaha.pm] Modern Perl web dev - another alternative Message-ID: <291DD189-7109-452B-91B2-1CFC55F7E4B0@iinteractive.com> Oh, I forgot to mention at our meeting: Catalyst sets up scaffolding, which I like. But if you hate scaffolding, here's one way to create a web app in 5 lines of code: use Dancer; get '/' => sub { "Hello World!" }; dance; More info: http://perldancer.org/ Enjoy, Jay Hannah Project Lead / Programmer http://www.iinteractive.com Email: jay.hannah at iinteractive.com AOL IM: deafferret Mobile: 1.402.598.7782 Fax: 1.402.691.9496 From jay at jays.net Fri Oct 11 10:44:21 2013 From: jay at jays.net (Jay Hannah) Date: Fri, 11 Oct 2013 12:44:21 -0500 Subject: [Omaha.pm] Mojo::DOM CSS selectors sure are handy Message-ID: <2E82044B-9A56-442C-A547-E6B48A16704A@jays.net> http://deafferret.tumblr.com/ Really enjoying the Mojo::DOM bit of Mojo, from the Mojolicious family of software, which I?ve never used before today. Drops nicely into Test::WWW::Mechanize :) The problem: For a series of websites, for a series of item numbers, if there?s a ?choose your item? table then make sure there are quantity_input fields too: The solution: my $mech = Test::WWW::Mechanize->new; foreach my $base (@base) { foreach my $i (@item_nums) { $mech->get_ok(item_url($base, $i)); diag("$i: " . $mech->title); my $dom = Mojo::DOM->new($mech->content); SKIP: { skip "has no 'choose your item' table", 1 unless $dom->find('table#chooseYourItem')->size; ok($dom->find('input.quantity_input')->size, "has grid qty inputs"); } } } Slick! :) Luis Roman wrote a much longer article about this, if you?re interested. http://deafferret.tumblr.com/ From jaybocc2 at gmail.com Mon Oct 14 10:30:18 2013 From: jaybocc2 at gmail.com (Jay Bendon) Date: Mon, 14 Oct 2013 10:30:18 -0700 Subject: [Omaha.pm] [OMG!Code] Tue Oct 8 meeting In-Reply-To: <9B1401A8-38BB-4AE7-B46D-C5ED16FD1166@iinteractive.com> References: <61D52159-3809-4957-864B-73230CD94AC2@iinteractive.com> <9B1401A8-38BB-4AE7-B46D-C5ED16FD1166@iinteractive.com> Message-ID: Hey Jay, Actually my wife and i relocated to seattle washington for the position with amazon! I don't know a whole lot about perl outside of small scripts but it all just feels much more complicated to write compared to python for similar web apps so hopefully i can alleviate some of my pain (or just convince everybody to use python...) --Jay On Wed, Oct 9, 2013 at 9:01 AM, Jay Hannah wrote: > On Oct 2, 2013, at 6:00 PM, Jay Bendon wrote: > > i'm interested in the presentation and summary of this presentation > since my team does a lot of perl at amazon and its absurdly painful to > develop in perl compared to python. Lol. > > Hi Jay, > > I'm bummed that you couldn't make it out to the meeting last night. I'm > really interested in the Python vs. Perl phenomenon as you experience it at > Amazon. I didn't know Amazon was in Omaha, using Perl. I'd love to hear a > lot more about that. :) > > Last night a big chunk of my presentation was about how awful Perl can be. > And how great Perl can be. I'm sure there's great and awful Python code out > there too. Seems to me great and awful is possible in every language. > > Anyway, I'd love to hear anything you could share. I'd love to help fix > your Perl stuff. :) > > Thanks, > > Jay Hannah > Project Lead / Programmer > http://www.iinteractive.com > Email: jay.hannah at iinteractive.com > AOL IM: deafferret > Mobile: 1.402.598.7782 > Fax: 1.402.691.9496 > > > > > > -- > OMG!Code http://code.omahamakergroup.org > --- > You received this message because you are subscribed to the Google Groups > "OMG!Code" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to omg-code+unsubscribe at googlegroups.com. > Visit this group at http://groups.google.com/group/omg-code. > For more options, visit https://groups.google.com/groups/opt_out. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Payne at MattPayne.org Mon Oct 14 14:38:49 2013 From: Payne at MattPayne.org (Matt Payne) Date: Mon, 14 Oct 2013 16:38:49 -0500 Subject: [Omaha.pm] [OMG!Code] Tue Oct 8 meeting In-Reply-To: References: <61D52159-3809-4957-864B-73230CD94AC2@iinteractive.com> <9B1401A8-38BB-4AE7-B46D-C5ED16FD1166@iinteractive.com> Message-ID: Congratulations on joining Amazon! How wonderful!! Hope you can tell some stories. What does Amazon use? PERL? Python? On Mon, Oct 14, 2013 at 12:30 PM, Jay Bendon wrote: > Hey Jay, > > Actually my wife and i relocated to seattle washington for the position > with amazon! > > I don't know a whole lot about perl outside of small scripts but it all > just feels much more complicated to write compared to python for similar > web apps so hopefully i can alleviate some of my pain (or just convince > everybody to use python...) > > > > --Jay > > > On Wed, Oct 9, 2013 at 9:01 AM, Jay Hannah wrote: > >> On Oct 2, 2013, at 6:00 PM, Jay Bendon wrote: >> > i'm interested in the presentation and summary of this presentation >> since my team does a lot of perl at amazon and its absurdly painful to >> develop in perl compared to python. Lol. >> >> Hi Jay, >> >> I'm bummed that you couldn't make it out to the meeting last night. I'm >> really interested in the Python vs. Perl phenomenon as you experience it at >> Amazon. I didn't know Amazon was in Omaha, using Perl. I'd love to hear a >> lot more about that. :) >> >> Last night a big chunk of my presentation was about how awful Perl can >> be. And how great Perl can be. I'm sure there's great and awful Python code >> out there too. Seems to me great and awful is possible in every language. >> >> Anyway, I'd love to hear anything you could share. I'd love to help fix >> your Perl stuff. :) >> >> Thanks, >> >> Jay Hannah >> Project Lead / Programmer >> http://www.iinteractive.com >> Email: jay.hannah at iinteractive.com >> AOL IM: deafferret >> Mobile: 1.402.598.7782 >> Fax: 1.402.691.9496 >> >> >> >> >> >> -- >> OMG!Code http://code.omahamakergroup.org >> --- >> You received this message because you are subscribed to the Google Groups >> "OMG!Code" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to omg-code+unsubscribe at googlegroups.com. >> Visit this group at http://groups.google.com/group/omg-code. >> For more options, visit https://groups.google.com/groups/opt_out. >> > > -- > OMG!Code http://code.omahamakergroup.org > --- > You received this message because you are subscribed to the Google Groups > "OMG!Code" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to omg-code+unsubscribe at googlegroups.com. > Visit this group at http://groups.google.com/group/omg-code. > For more options, visit https://groups.google.com/groups/opt_out. > -- "To go faster, slow down. Everybody who knows about orbital mechanics understands that." -- Scott Cherf as quoted at http://www.multicians.org/thvv/proverbs.html -------------- next part -------------- An HTML attachment was scrubbed... URL: From jay.hannah at iinteractive.com Mon Oct 14 15:50:09 2013 From: jay.hannah at iinteractive.com (Jay Hannah) Date: Mon, 14 Oct 2013 17:50:09 -0500 Subject: [Omaha.pm] [OMG!Code] Tue Oct 8 meeting In-Reply-To: References: <61D52159-3809-4957-864B-73230CD94AC2@iinteractive.com> <9B1401A8-38BB-4AE7-B46D-C5ED16FD1166@iinteractive.com> Message-ID: <2E24A717-A6A9-4417-9C22-F458E4814414@iinteractive.com> On Oct 14, 2013, at 12:30 PM, Jay Bendon wrote: > Actually my wife and i relocated to seattle washington for the position with amazon! Ah. Are you enjoying WA? > I don't know a whole lot about perl outside of small scripts but it all just feels much more complicated to write compared to python for similar web apps so hopefully i can alleviate some of my pain (or just convince everybody to use python...) -nod- Like most things, Perl can suck. Bummer that yours does. If you can posted a painful sample I (or the Seattle Perl Mongers (ancient web site (ugh))) might be able to "Modern Perl" it for you. Cheers, Jay Hannah Project Lead / Programmer http://www.iinteractive.com Email: jay.hannah at iinteractive.com AOL IM: deafferret Mobile: 1.402.598.7782 Fax: 1.402.691.9496 From jaybocc2 at gmail.com Mon Oct 14 16:05:37 2013 From: jaybocc2 at gmail.com (Jay Bendon) Date: Mon, 14 Oct 2013 16:05:37 -0700 Subject: [Omaha.pm] [OMG!Code] Tue Oct 8 meeting In-Reply-To: References: <61D52159-3809-4957-864B-73230CD94AC2@iinteractive.com> <9B1401A8-38BB-4AE7-B46D-C5ED16FD1166@iinteractive.com> Message-ID: for scripting and automation (and a lot of other things as you would suspect) has been done in perl. There are some efforts i've heard of in regards to moving to python. The officially company supported languages are C++, java, perl, ruby. Unlike Google though you are allowed to contribute with any language as long as you can get it to compile and your team is ok with that language. We are loving washington to be honest. I spent my whole life in nebraska and it really is refreshing to see be in a different environment everyday. I'll see if i can come up with an example to work on... Probably gonna have to find myself a decent perl book. --Jay On Mon, Oct 14, 2013 at 2:38 PM, Matt Payne wrote: > Congratulations on joining Amazon! How wonderful!! Hope you can tell > some stories. > > What does Amazon use? PERL? Python? > > > On Mon, Oct 14, 2013 at 12:30 PM, Jay Bendon wrote: > >> Hey Jay, >> >> Actually my wife and i relocated to seattle washington for the position >> with amazon! >> >> I don't know a whole lot about perl outside of small scripts but it all >> just feels much more complicated to write compared to python for similar >> web apps so hopefully i can alleviate some of my pain (or just convince >> everybody to use python...) >> >> >> >> --Jay >> >> >> On Wed, Oct 9, 2013 at 9:01 AM, Jay Hannah wrote: >> >>> On Oct 2, 2013, at 6:00 PM, Jay Bendon wrote: >>> > i'm interested in the presentation and summary of this presentation >>> since my team does a lot of perl at amazon and its absurdly painful to >>> develop in perl compared to python. Lol. >>> >>> Hi Jay, >>> >>> I'm bummed that you couldn't make it out to the meeting last night. I'm >>> really interested in the Python vs. Perl phenomenon as you experience it at >>> Amazon. I didn't know Amazon was in Omaha, using Perl. I'd love to hear a >>> lot more about that. :) >>> >>> Last night a big chunk of my presentation was about how awful Perl can >>> be. And how great Perl can be. I'm sure there's great and awful Python code >>> out there too. Seems to me great and awful is possible in every language. >>> >>> Anyway, I'd love to hear anything you could share. I'd love to help fix >>> your Perl stuff. :) >>> >>> Thanks, >>> >>> Jay Hannah >>> Project Lead / Programmer >>> http://www.iinteractive.com >>> Email: jay.hannah at iinteractive.com >>> AOL IM: deafferret >>> Mobile: 1.402.598.7782 >>> Fax: 1.402.691.9496 >>> >>> >>> >>> >>> >>> -- >>> OMG!Code http://code.omahamakergroup.org >>> --- >>> You received this message because you are subscribed to the Google >>> Groups "OMG!Code" group. >>> To unsubscribe from this group and stop receiving emails from it, send >>> an email to omg-code+unsubscribe at googlegroups.com. >>> Visit this group at http://groups.google.com/group/omg-code. >>> For more options, visit https://groups.google.com/groups/opt_out. >>> >> >> -- >> OMG!Code http://code.omahamakergroup.org >> --- >> You received this message because you are subscribed to the Google Groups >> "OMG!Code" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to omg-code+unsubscribe at googlegroups.com. >> Visit this group at http://groups.google.com/group/omg-code. >> For more options, visit https://groups.google.com/groups/opt_out. >> > > > > -- > "To go faster, slow down. Everybody who knows about orbital mechanics > understands that." > -- Scott Cherf as quoted at http://www.multicians.org/thvv/proverbs.html > > -- > OMG!Code http://code.omahamakergroup.org > --- > You received this message because you are subscribed to the Google Groups > "OMG!Code" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to omg-code+unsubscribe at googlegroups.com. > Visit this group at http://groups.google.com/group/omg-code. > For more options, visit https://groups.google.com/groups/opt_out. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jay at jays.net Fri Oct 18 08:46:45 2013 From: jay at jays.net (Jay Hannah) Date: Fri, 18 Oct 2013 09:46:45 -0600 Subject: [Omaha.pm] Template::Alloy contexts References: <526138B9.2070402@seamons.com> Message-ID: <6B2E04B6-A844-4B0B-8449-D13FA8E0582F@jays.net> ... wow. Template::Alloy is ... wow. Check it out if you've always wished Perl 5's context stuff was more complicated. :) Perl++ # you can do ANYTHING. :) j Begin forwarded message: > From: Paul Seamons > Subject: Re: [Templates] force resultset as array > Date: October 18, 2013 7:33:45 AM MDT > To: templates at template-toolkit.org > > On 10/18/2013 05:03 AM, Spevak, Martin wrote: >> Hello, >> >> I have small problem with TT while getting DBIx::ResultSet. For instance >> I have stash variable team which ich DBIx::Result (one entry). In DBIx >> exists relations team_accesses as has_many. So in TT I am using: >> >> team_accesses = team.team_accesses; >> >> Problem is: >> when team has no accesses, variable team_accesses is empty string ('') >> when 1 access exists, variable contain hash which is result >> DBIx::TeamAccess. >> when exists more than 1 access, variable contains array of >> DBIx::TreamAccess. >> Is the way how to say TT, that result needs to be converted to array? >> >> I tried: team_access = [ team.team_accesses ], but my results are, >> [ '' ], [DBIx::Result], [[DBIx::Result]] >> >> > I had tried to get CALL_CONTEXT added to Template::Toolkit, but as I was giving patches for adding various features, it was deemed that that would make the grammar grow too large. So, while it isn't a good direct answer for how to do it in Template::Toolkit, it is possible to do this in Template::Alloy, but either way this portion from the Template::Alloy documentation does give more information about Template::Toolkit smart context: > > > CALL_CONTEXT (Not in TT) > Can be one of 'item', 'list', or 'smart'. The default type is 'smart'. The CALL_CONTEXT configuration specifies in what Perl context coderefs and methods used in the processed templates will be called. TT historically has avoided the distinction of item (scalar) vs list context. To avoid worrying about this, TT introduced 'smart' context. The @() and $() context specifiers make it easier to use CALL_CONTEXT in some situations. > > The following table shows the relationship between the various contexts: > > return values smart context list context item context > ------------- ------------- ------------ ------------ > A 'foo' 'foo' ['foo'] 'foo' > B undef undef [undef] undef > C (no return value) undef [] undef > D (7) 7 [7] 7 > E (7,8,9) [7,8,9] [7,8,9] 9 > F @a = (7) 7 [7] 1 > G @a = (7,8,9) [7,8,9] [7,8,9] 3 > H ({b=>"c"}) {b=>"c"} [{b=>"c"}] {b=>"c"} > I ([1]) [1] [[1]] [1] > J ([1],[2]) [[1],[2]] [[1],[2]] [2] > K [7,8,9] [7,8,9] [[7,8,9]] [7,8,9] > L (undef, "foo") die "foo" [undef, "foo"] "foo" > M wantarray?1:0 1 [1] 0 > Cases F, H, I and M are common sticking points of the smart context in TT2. Note that list context always returns an arrayref from a method or function call. Smart context can give confusing results sometimes, especially the I and J cases. Case L for smart match is very surprising. > > The list and item context provide another feature for method calls. In smart context, TT will look for a hash key in the object by the same name as the method, if a method by that name doesn't exist. In item and list context Alloy will die if a method by that name cannot be found. > > The CALL_CONTEXT configuration item can be passed to new or it may also be set during runtime using the CONFIG directive. The following method call would be in list context: > > [% CONFIG CALL_CONTEXT => 'list'; > results = my_obj.get_results; > CONFIG CALL_CONTEXT => 'smart' > %] > Note that we needed to restore CALL_CONTEXT to the default 'smart' value. Template::Alloy has added the @() (list) and the $() (item) context specifiers. The previous example could be written as: > > [% results = @( my_obj.get_results ) %] > To call that same method in item (scalar) context you would do the following: > > [% results = $( my_obj.get_results ) %] > _______________________________________________ > templates mailing list > templates at template-toolkit.org > http://mail.template-toolkit.org/mailman/listinfo/templates -------------- next part -------------- An HTML attachment was scrubbed... URL: From jay at jays.net Sat Oct 19 07:16:30 2013 From: jay at jays.net (Jay Hannah) Date: Sat, 19 Oct 2013 09:16:30 -0500 Subject: [Omaha.pm] "Make Perl Nerd Merit Badges" on @crowdtilt Message-ID: What? You don't follow me on Twitter? Here you go: @deafferret: I just contributed to "Make Perl Nerd Merit Badges" on @crowdtilt. Join me! http://t.co/3auhbHCZYT. :) -------------- next part -------------- An HTML attachment was scrubbed... URL: From dan at linder.org Mon Oct 28 13:39:53 2013 From: dan at linder.org (Dan Linder) Date: Mon, 28 Oct 2013 15:39:53 -0500 Subject: [Omaha.pm] Processing a CSV file. Message-ID: I have a simple CSV file with the header row, and a values row. For a secondary system to process the data I need to massage the CSV into a Key-Value pair file. Example of CSV: name,age,gender,zip john,33,male,68000 What I need is to produce a file with this: name=john age=33 gender=male zip=68000 Using Text::CSV I'm close, but I don't like the code I came up with: my $csv = Text::CSV->new( { binary => 1 } ); my $headers = $csv->parse($search_results_csv->getline()); my @headers2 = $csv->fields(); my $values = $csv->parse($search_results_csv->getline()); my @values2 = $csv->fields(); for (my $index = 0; $index < scalar @headers2; $index++ ) { printf ("%s=%s\n", $headers2[$index], $values2[$index]); } Is there a cleaner way of getting the @headers2 and @values2 array and then walking through both of them in the for loop? I thought I could set the header once (using column_names() ?) and then pull in the values line and do a foreach on the headers, but I couldn't get that to work. Thoughts or examples? Thanks, Dan -- ***************** ************* *********** ******* ***** *** ** "Quis custodiet ipsos custodes?" (Who can watch the watchmen?) -- from the Satires of Juvenal "I do not fear computers, I fear the lack of them." -- Isaac Asimov (Author) ** *** ***** ******* *********** ************* ***************** -------------- next part -------------- An HTML attachment was scrubbed... URL: From djgoku at gmail.com Mon Oct 28 13:58:24 2013 From: djgoku at gmail.com (djgoku at gmail.com) Date: Mon, 28 Oct 2013 15:58:24 -0500 Subject: [Omaha.pm] Processing a CSV file. In-Reply-To: References: Message-ID: <11E98154-4D23-481D-BBBB-3CFBEC7F88E3@gmail.com> Maybe https://metacpan.org/pod/Text::CSV::Hashify Jonathan Otsuka On Oct 28, 2013, at 3:39 PM, Dan Linder wrote: > I have a simple CSV file with the header row, and a values row. For a secondary system to process the data I need to massage the CSV into a Key-Value pair file. > > Example of CSV: > name,age,gender,zip > john,33,male,68000 > > What I need is to produce a file with this: > name=john > age=33 > gender=male > zip=68000 > > Using Text::CSV I'm close, but I don't like the code I came up with: > my $csv = Text::CSV->new( { binary => 1 } ); > my $headers = $csv->parse($search_results_csv->getline()); > my @headers2 = $csv->fields(); > my $values = $csv->parse($search_results_csv->getline()); > my @values2 = $csv->fields(); > for (my $index = 0; $index < scalar @headers2; $index++ ) { > printf ("%s=%s\n", $headers2[$index], $values2[$index]); > } > > Is there a cleaner way of getting the @headers2 and @values2 array and then walking through both of them in the for loop? > > I thought I could set the header once (using column_names() ?) and then pull in the values line and do a foreach on the headers, but I couldn't get that to work. > > Thoughts or examples? > > Thanks, > Dan > > -- > ***************** ************* *********** ******* ***** *** ** > "Quis custodiet ipsos custodes?" > (Who can watch the watchmen?) > -- from the Satires of Juvenal > "I do not fear computers, I fear the lack of them." > -- Isaac Asimov (Author) > ** *** ***** ******* *********** ************* ***************** > _______________________________________________ > Omaha-pm mailing list > Omaha-pm at pm.org > http://mail.pm.org/mailman/listinfo/omaha-pm -------------- next part -------------- An HTML attachment was scrubbed... URL: From jay at jays.net Mon Oct 28 17:13:05 2013 From: jay at jays.net (Jay Hannah) Date: Mon, 28 Oct 2013 18:13:05 -0600 Subject: [Omaha.pm] Processing a CSV file. In-Reply-To: References: Message-ID: <294D3D22-7E3E-403D-B843-298F4500A2EF@jays.net> On Oct 28, 2013, at 2:39 PM, Dan Linder wrote: > Is there a cleaner way of getting the @headers2 and @values2 array and then walking through both of them in the for loop? hmmm... this is one of those cases where I'd probably stick with a C-style for loop. :) > I thought I could set the header once (using column_names() ?) and then pull in the values line and do a foreach on the headers, but I couldn't get that to work. > > Thoughts or examples? Does this help? https://github.com/jhannah/sandbox/blob/master/danlinder/go.pl Cheers, j From gottobtru at gmail.com Mon Oct 28 23:03:41 2013 From: gottobtru at gmail.com (Howard Parks) Date: Tue, 29 Oct 2013 01:03:41 -0500 Subject: [Omaha.pm] Processing a CSV file. In-Reply-To: <294D3D22-7E3E-403D-B843-298F4500A2EF@jays.net> References: <294D3D22-7E3E-403D-B843-298F4500A2EF@jays.net> Message-ID: See also Text::CSV::Slurp - assumes first line is header, creates hashref. On Mon, Oct 28, 2013 at 7:13 PM, Jay Hannah wrote: > On Oct 28, 2013, at 2:39 PM, Dan Linder wrote: >> Is there a cleaner way of getting the @headers2 and @values2 array and then walking through both of them in the for loop? > > hmmm... this is one of those cases where I'd probably stick with a C-style for loop. :) > >> I thought I could set the header once (using column_names() ?) and then pull in the values line and do a foreach on the headers, but I couldn't get that to work. >> >> Thoughts or examples? > > Does this help? > > https://github.com/jhannah/sandbox/blob/master/danlinder/go.pl > > Cheers, > > j > > > > > _______________________________________________ > Omaha-pm mailing list > Omaha-pm at pm.org > http://mail.pm.org/mailman/listinfo/omaha-pm From rob.townley at gmail.com Tue Oct 29 15:05:26 2013 From: rob.townley at gmail.com (Rob Townley) Date: Tue, 29 Oct 2013 17:05:26 -0500 Subject: [Omaha.pm] Processing a CSV file. In-Reply-To: References: <294D3D22-7E3E-403D-B843-298F4500A2EF@jays.net> Message-ID: Jay, my CentOS 6.4 box only has perl 5.10.1 but your code still worked. Might there be cases where it would not and 5.18.0 is required? On Tue, Oct 29, 2013 at 1:03 AM, Howard Parks wrote: > See also Text::CSV::Slurp - assumes first line is header, creates hashref. > > On Mon, Oct 28, 2013 at 7:13 PM, Jay Hannah wrote: >> On Oct 28, 2013, at 2:39 PM, Dan Linder wrote: >>> Is there a cleaner way of getting the @headers2 and @values2 array and then walking through both of them in the for loop? >> >> hmmm... this is one of those cases where I'd probably stick with a C-style for loop. :) >> >>> I thought I could set the header once (using column_names() ?) and then pull in the values line and do a foreach on the headers, but I couldn't get that to work. >>> >>> Thoughts or examples? >> >> Does this help? >> >> https://github.com/jhannah/sandbox/blob/master/danlinder/go.pl >> >> Cheers, >> >> j >> >> >> >> >> _______________________________________________ >> Omaha-pm mailing list >> Omaha-pm at pm.org >> http://mail.pm.org/mailman/listinfo/omaha-pm > _______________________________________________ > Omaha-pm mailing list > Omaha-pm at pm.org > http://mail.pm.org/mailman/listinfo/omaha-pm From dan at linder.org Tue Oct 29 16:49:18 2013 From: dan at linder.org (Dan Linder) Date: Tue, 29 Oct 2013 18:49:18 -0500 Subject: [Omaha.pm] Processing a CSV file. In-Reply-To: <294D3D22-7E3E-403D-B843-298F4500A2EF@jays.net> References: <294D3D22-7E3E-403D-B843-298F4500A2EF@jays.net> Message-ID: Thanks for the code option. As with everything Perl, there are multiple ways to solve the problem. Dan On Oct 28, 2013 7:13 PM, "Jay Hannah" wrote: > On Oct 28, 2013, at 2:39 PM, Dan Linder wrote: > > Is there a cleaner way of getting the @headers2 and @values2 array and > then walking through both of them in the for loop? > > hmmm... this is one of those cases where I'd probably stick with a C-style > for loop. :) > > > I thought I could set the header once (using column_names() ?) and then > pull in the values line and do a foreach on the headers, but I couldn't get > that to work. > > > > Thoughts or examples? > > Does this help? > > https://github.com/jhannah/sandbox/blob/master/danlinder/go.pl > > Cheers, > > j > > > > > _______________________________________________ > Omaha-pm mailing list > Omaha-pm at pm.org > http://mail.pm.org/mailman/listinfo/omaha-pm > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jay at jays.net Wed Oct 30 16:17:16 2013 From: jay at jays.net (Jay Hannah) Date: Wed, 30 Oct 2013 18:17:16 -0500 Subject: [Omaha.pm] Processing a CSV file. In-Reply-To: References: <294D3D22-7E3E-403D-B843-298F4500A2EF@jays.net> Message-ID: <9AD994D2-1D49-49E4-9FD1-66A83F614335@jays.net> On Oct 29, 2013, at 5:05 PM, Rob Townley wrote: > Jay, my CentOS 6.4 box only has perl 5.10.1 but your code still > worked. Might there be cases where it would not and 5.18.0 is > required? Ya, sorry. I put "use 5.18.0;" on the top out of habit. I think it implies "use strict;" and/or "use warnings;". Can't remember which / both / whatever. :) My solution was probably compatible with any Perl 5. :) j From evaddnomaid at gmail.com Thu Oct 31 10:09:55 2013 From: evaddnomaid at gmail.com (Dave Burchell) Date: Thu, 31 Oct 2013 12:09:55 -0500 Subject: [Omaha.pm] Tues. Nov. 5 meeting: OpenStack Message-ID: Hey all, Dutch Edwards has graciously given up his slot at the Nov. 5 meeting so I can talk about OpenStack. I wanted to get the talk in before Hack Omaha 2013 at the end of November. HP Cloud is a Hack Omaha sponsor, and they are offering free hosting on HP's OpenStack implementation for Hack Omaha projects. (For more on "Hack Omaha 3: With a Vengeance" see http://hackomaha.eventbrite.com/ ) OpenStack (http://openstack.org) is a collection of free and open source software to provide a cloud infrastructure. It is a standards-based alternative to proprietary vendor cloud offerings, such as Amazon's Web Services, and is supported by vendors such as Rackspace and HP. I'll introduce the OpenStack technology, compare with other cloud services, and do a sample deploy workshop with HP's stack. Then we can address questions and drill down to specifics. HP is chipping in for drinks and snacks. I'll bring the Zipline Copper Alt. Other requests? Any certain Perl app people would like to see deployed? (Bugzilla perhaps?) -- Dave Burchell @evaddnomaid -------------- next part -------------- An HTML attachment was scrubbed... URL: