From chardin at valueclick.com Mon Apr 2 14:13:01 2012 From: chardin at valueclick.com (Chuck Hardin) Date: Mon, 2 Apr 2012 14:13:01 -0700 Subject: [Thousand-Oaks-pm] Next TO Perl Mongers meeting is Wednesday, April 11! Message-ID: <4F7A165D.8080307@valueclick.com> It's April, and we already have one presentation for you: Barry Brevik will show you a generic CGI test utility which can be used in a broad variety of ways. We have a slot left for a second presenter, so if you have a topic you'd like to explain or discuss, now's the time to tell us. I look forward to seeing you all there! -- Chuck Hardin Software Engineer, ValueClick Media +1-818-575-4573 chardin at valueclick.com This email and any files included with it may contain privileged, proprietary and/or confidential information that is for the sole use of the intended recipient(s). Any disclosure, copying, distribution, posting, or use of the information contained in or attached to this email is prohibited unless permitted by the sender. If you have received this email in error, please immediately notify the sender via return email, telephone, or fax and destroy this original transmission and its included files without reading or saving it in any manner. Thank you. -------------- next part -------------- An HTML attachment was scrubbed... URL: From chardin at valueclick.com Tue Apr 3 11:20:14 2012 From: chardin at valueclick.com (Chuck Hardin) Date: Tue, 3 Apr 2012 11:20:14 -0700 Subject: [Thousand-Oaks-pm] Next TO Perl Mongers meeting is Wednesday, April 11! In-Reply-To: <4F7A165D.8080307@valueclick.com> References: <4F7A165D.8080307@valueclick.com> Message-ID: <4F7B3F5E.2030108@valueclick.com> We have our second volunteer: David Oswald, who will present the first in a two-part series on "A CPAN Author's Power Tools". These tools are useful for deploying Perl modules even if you don't upload them to CPAN, and David has a lot of recent experience in using them. Full details are, as always, available at http://thousand-oaks.pm.org/ for your edification. See you then! On 04/02/2012 02:13 PM, Chuck Hardin wrote: > It's April, and we already have one presentation for you: Barry > Brevik will show you a generic CGI test utility which can be used in a > broad variety of ways. > > We have a slot left for a second presenter, so if you have a topic > you'd like to explain or discuss, now's the time to tell us. > > I look forward to seeing you all there! > -- > Chuck Hardin Software Engineer, ValueClick Media > +1-818-575-4573 chardin at valueclick.com > > This email and any files included with it may contain privileged, > proprietary and/or confidential information that is for the sole use > of the intended recipient(s). Any disclosure, copying, distribution, > posting, or use of the information contained in or attached to this > email is prohibited unless permitted by the sender. If you have > received this email in error, please immediately notify the sender > via return email, telephone, or fax and destroy this original transmission > and its included files without reading or saving it in any manner. > Thank you. > > > > _______________________________________________ > ThousandOaks.pm - Thousand Oaks Perl Mongers > Website: http://thousand-oaks.pm.org/ > Mailing list: http://mail.pm.org/mailman/listinfo/thousand-oaks-pm -- Chuck Hardin Software Engineer, ValueClick Media +1-818-575-4573 chardin at valueclick.com This email and any files included with it may contain privileged, proprietary and/or confidential information that is for the sole use of the intended recipient(s). Any disclosure, copying, distribution, posting, or use of the information contained in or attached to this email is prohibited unless permitted by the sender. If you have received this email in error, please immediately notify the sender via return email, telephone, or fax and destroy this original transmission and its included files without reading or saving it in any manner. Thank you. -------------- next part -------------- An HTML attachment was scrubbed... URL: From chardin at valueclick.com Tue Apr 10 11:45:24 2012 From: chardin at valueclick.com (Chuck Hardin) Date: Tue, 10 Apr 2012 11:45:24 -0700 Subject: [Thousand-Oaks-pm] Reminder: TO Perl Mongers is tomorrow at 7 PM! Message-ID: <4F847FC4.3060304@valueclick.com> We have two presentations scheduled and plenty of free parking! Seehttp://thousand-oaks.pm.org/ for details. See you there! -- Chuck Hardin Software Engineer, ValueClick Media +1-818-575-4573 chardin at valueclick.com This email and any files included with it may contain privileged, proprietary and/or confidential information that is for the sole use of the intended recipient(s). Any disclosure, copying, distribution, posting, or use of the information contained in or attached to this email is prohibited unless permitted by the sender. If you have received this email in error, please immediately notify the sender via return email, telephone, or fax and destroy this original transmission and its included files without reading or saving it in any manner. Thank you. -------------- next part -------------- An HTML attachment was scrubbed... URL: From daoswald at gmail.com Wed Apr 11 22:33:40 2012 From: daoswald at gmail.com (David Oswald) Date: Wed, 11 Apr 2012 22:33:40 -0700 Subject: [Thousand-Oaks-pm] Slides from the presentation on building a CPAN distribution. Message-ID: The slides from my presentation this evening are available on Github at: https://github.com/daoswald/CPAN-Power-Tools-Talk There is one .odp file. That is the slide show in Libre Office Presentation format. There are other files related to the Mojolicious driven version of the presentation. And in the public/ directory of the repo the HTML version resides. Dave -- David Oswald daoswald at gmail.com From daoswald at gmail.com Thu Apr 12 19:31:11 2012 From: daoswald at gmail.com (David Oswald) Date: Thu, 12 Apr 2012 19:31:11 -0700 Subject: [Thousand-Oaks-pm] Responding to Barry's question on basing a module on C code. Message-ID: Last night Barry asked the good question of how one might embed C code in a Perl module. I wanted to just respond briefly here. There are several ways to do it, as you might expect. The first option (and probably most difficult) is to learn the Perl XS glue language and write your module in XS code, which gets translated by ExtUtils::ParseXS to C. Details for this method are found in perlxstut, perlxs, perlapi, perlcall, perlguts, and ExtUtils::ParseXS POD. A few brave souls do it this way. I don't recommend it because there are easier ways. The next option is much easier. I know several prolific CPAN authors who use this technique. Write a program using Inline::C, and include the C code inline in the Perl script as discussed in the Inline::C and Inline::C-Cookbook documentation. You will probably still need to read perlguts at minimum, as well as the POD for Inline, Inline::C, and Inline::C-Cookbook. But here's the cool part: If you use the "use Inline => 'NoClean'; option, then after your script runs you will be left with an XS file in its _Inline build directory. Now start an XS module with 'h2xs -XAn My::Module', and then copy and paste the code contained in the _Inline/*.xs file to the end of the XS file generated by h2xs. Presto, no need to specifically learn the XS glue language; Inline::C writes it for you. For a module intended for broad use (and presumably maximum portability), that's the best method. As an author, you use Inline::C, but by copying and pasting the XS code it generates into your new module, you literally shed the Inline::C dependency for your users. The third option is the easiest of all, but retains the Inline::C dependency. Go ahead and start your module with Module::Starter. In your module's code, "use Inline C => 'DATA';", and then place your C code after the __DATA__ segment in the module. Within your Makefile.PL, replace ExtUtils::MakeMaker with Inline::MakeMaker. List ExtUtils::MakeMaker version 6.52, and Inline::MakeMaker version 0.50 as CONFIGURE_REQUIRES dependencies, and Inline and Inline::C version 0.50 as BUILD_REQUIRES dependencies in Makefile.PL. Now when your module is installed on a target system, your C extension code will be compiled once, upon installation. Subsequent runs using the module will not incur the compilation penalty, just the initial install. The biggest downside to this is that it will pull in Inline and Inline::C on the target system. Those modules are highly portable, but their installation takes some time (the test suite is slow). sisyphus at cpan.org also has an Inline::C2XS and Inline::CPP2XS set of modules that sort of automate the second option mentioned above. They work quite well. As a proof-of-concept for the third option (the Inline dependency option), see Math::Prime::FastSieve, which uses Inline::CPP as a module dependency to allow the module to be built around C++ code. So to summarize: 1: Write the XS code yourself. -- Difficulty: Hard to Diabolical. 2: Let Inline::C write the XS code for you, and then use Inline::C2XS reappropriate the XS code into your new module. -- No strange dependencies for target users. -- Difficulty: Medium-hard. 3: Use Inline::C as a module dependency. -- User will be forced to pull in the Inline::C dependency (it's pretty easy but takes time). Runtime is just as efficient as pure XS. -- Difficulty: Easy to Medium. Dave -- David Oswald daoswald at gmail.com