I'm a self employed hacker. My development (actually, my total) infrastructure consists of a six-year old laptop running Linux with a full disk and a noisy fan, and a rented virtual server, also Linux. I have a few modules up on CPAN, which occasionally receive reports from cpantesters or the odd individual user with a build/test failure on a platform I don't have access to. Blinding attempting fixes and waiting for reports is tedious and inefficient.
There are a few no-cost BSD shell providers around, which has allowed me to develop and test directly on that platform. However I haven't found anything similar for Win32. I vaguely remember some offering from Microsoft for CPAN developers, but can no longer find any reference to it. Can someone jog my memory, or give me a pointer to an alternative service?
When I was starting out as a programmer, I used to work with an
engineer who insisted that we write the comments to our C code at the
end of the lines, starting in column 80. "That way", he said, "I can
read the code without being distracted by the comments". I think it
was more his assembly code experience that made him prefer that style,
but unobtrusive comments are certainly a worthwhile goal. Later, I
came up with my own solution to the problem, and although in over
twenty years I have seen only one other programmer who uses it, I
use it all the time in my projects and I wish more people used it too.
On Feb 28, 2013 I gave a talk to Chicago.pm about Mojolicious. I called it an introduction, but I really wanted to show some of the features that sets Mojolicious apart. Because of this, the talk moves very fast. It hits routing and responses quickly, hits testing often, on all the way to well-tested non-blocking websocket examples.
I promised to get my slides up afterwards but life (i.e. my doctoral thesis) got in the way. Now with the release of Mojolicious 4.0 I thought I would take the opportunity to right a wrong and get the slides up; so here they are: http://mojolicious-introduction.herokuapp.com/!
The talk is itself a Mojolicious app, the source of which is available from on GitHub. Not only are all the code snippets shown in the talk included, not only do they all run, but they are actually what is rendered by the talk (DRY++), so what you see is what you get! Please leave any feedback and ask any questions. I may not see the responses here, so feel free to ping me elsewhere if needed.
I'm developing under Catalyst and am using the Catalyst test server that is running on my local machine and is reloading every time I'm saving changes to the source tree. This is a cool feature, but I have to wait in front of the browser until the application is loaded full and can answer http requests; if I hit F5 in the browser before it is up and running I get a connection refused error and have to hit it again.
Finally I got tired of that and wrote this little hack that shows a load indicator on my ubuntu desktop. The thing is very primitive. While Catalyst app is loading, it blinks yellow. If it has loaded ok, it shows green light for a couple of seconds and then disappears. If there was a failure (syntax failure in my case most of the time), it shows red light which doesn't go away until the problem is fixed.
Live coding basically consists in performing evaluation of code when it comes from the text editor to a running script, but I also wanted persistent lexicals between eval's. One of ways is to predefine lexicals (or make simple context hash) and/or use $::somevar / $'somevar syntax to create/modify mainpackagevars and/or define global lexicals with use vars qw($one @two %three). Live environment should have asynchronous capability, and AnyEvent was the first option that came to my mind.
Hence, I created perl script which represents running interpreter with optional (but default) PadWalker/Package::Stash processing in order to move my's declarations to global context. And some elisp stuff to communicate with running interpreter from emacs.
The famous libnet modules provide Perl programmers with a low level interface to POP3 and SMTP servers, among others.
This works fine in general but over the past years most mail servers stopped offering 'plain' SMTP and POP3 access, but use either SSL or TLS encryption. This has lead to a plethora of modules on CPAN to support SMTP via SSL or TLS and also for POP3 via SSL. Until recently this was not the case for POP3 using TLS security. But earlier this week Steffen Ullrich, the maintainer of IO::Socket::SSL, released a new version of Net::SSLGlue that also allows for connecting to POP3 over TLS. And as opposed to many of the other modules, it also allows to verify the SSL certificate on the remote server for extra security. Net::SSLGlue works for Net::SMTP, Net::POP3, Net::LDAP, and LWP.
Here is an example of how you can connect to a POP3 mail server over TLS:
"Plack - Perl Superglue for Web frameworks and Web Servers (PSGI toolkit)" as said in documentation. Dealing with perl applications deployment, which I do with chef - modern open source platform for configuration, I have written psgi cookbook to configure, install psgi applications. Here are some simple exmaples of usage which are self explanatory.
This snippet of code install Catalyst application as fast cgi standalone server:
psgi_application 'Catalyst FCGI application' do
operator 'Dancer'
application_user 'user'
application_home '/home/user/app/'
script '/home/user/app/scripts/foo.psgi'
config '/home/user/app/app.conf'
action 'install'
end
And this snippet of code installs Dancer application as Starman web server:
Just reading Brent Laabs post on Porting a Module to Perl 6 and two things occurred to me. The first was that I should start getting into Perl 6 sooner rather than later and get the few modules I'm involved with changed over, ready for the big day.
The second and more important one is that, if I'm to assure myself that the module behaves in the same way as the Perl 5 module, the original tests need to pass. I would have invested much on those tests to verify the module works the way I think it should. To avoid finger trouble in re-writing those tests, I would sleep better if some kind soul could create the bit of magic that will parse [your favourite testing framework] and run it against my future Perl 6 module. Or, conversely, to write Perl 6 tests that run against Perl 5 modules and verify that the new suite is identical to the old suite, so I can then proceed with porting the module.
Maybe this is already possible in Rakudo. I don't even know how much I don't know.
Stop me if you have heard this one before. You have a list of files you need to process in a text file with one item per line. Handling this is fairly simple you read a line in and process it over and over again until you processed the whole list. This works great, but if that list is 40,000 items long and each item takes up to 30 seconds to run it suddenly takes a very long time to finish. In this case processing each item is just a system call to another cli application with no shared resources, thus allowing processing of items in parallel with no fuss. For this task I am using Parallel::ForkManager and here are the important bits:
Pinto is an application for creating and managing a custom CPAN-like repository of Perl modules. You may find many posts on it on the site. I love the idea of pinto, so decided to contribute in some way. So there is pinto cookbook - a chef cookbook to install and configures pinto applications. I hope this cookbook will be useful for pinto users and developers.
The crowd funding campaign for Pinto ended last week and I'm delighted to report that it was a huge success! We completely surpassed our goal and received a total of $4,620.12 from 128 contributors (including payments through PayPal and Flattr).
I am extremely grateful to each and every contributor, and I am deeply moved by the overwhelming support of the Perl community at large. As a humble token of my appreciation, every contributor will get a free lifetime account on Stratopan. I will also list the name of every contributor in the documentation for Pinto and on the project web site.
I believe the success of this campaign has a lot to teach us about the strength of the Perl community, the power of crowd funding, and the future of open source software. So over the next several days, I'll be blogging about each of those things. And of course, you'll also be hearing about the progress I've made toward implementing the promised features in PInto.
Notes from a Newbie document the creation and deployment of yardbirdfanclub.org with Perl Catalyst on shared hosting. They are intended for a Perl Catalyst Newbie who would like to study the creation and deployment of a simple Perl Catalyst application.
Now that we've developed a simple, functional application I will give you some information and advice about deploying it to a shared host.
It was bugging me that autocomplete for the perldoc command worked for modules and functions but not for bare .pod files. I'd be reading the FooBar docs and find a reference to FooBar::Cookbook::Tutorial and the magic TAB key would not find it for me. :(
--- /usr/share/bash-completion/helpers/perl.orig 2013-05-13 06:25:09.163377047 -0700
+++ /usr/share/bash-completion/helpers/perl 2013-05-13 04:10:34.523819280 -0700
@@ -23,8 +23,8 @@
chdir($dir) or return;
# print each file
- foreach my $file (glob('*.pm}')) {
- $file =~ s/\.pm$//;
+ foreach my $file (glob('*.{pm,pod}')) {
+ $file =~ s/\.(?:pm|pod)$//;
my $module = $base . $file;
next if $module !~ /^\Q$word/;
next if $seen{$module}++;
Welcome to Perl 5 Porters Weekly, a summary of the email traffic of the
perl5-porters email list. The big news this week is the release of
perl-5.18.0-RC1 and RC2.
Yep, indeed, contributing to the Perl community can be a very ludic activity (not to be confused with luddite!). I tried to list every Perl-related web resource where participants are encouraged to build up some kind of score. Most have charts where participants compete for the highest rank while some has an absolute goal (like 100% test coverage). The list has no specific order. Feel free to post the resources I forgot/am unaware of in comments!
Hi everyone, this is my first blog post on here (Gabor Szabo++ for reminding me
that I need to blog!).
Last week, I posted
to the Houston.pm group inviting them to come out to the local City of Houston
Open Innovation Hackathon.
I was planning on attending since I first heard about it a couple of weeks ago,
but I saw this also as an opportunity to build cool things in Perl and show
what Perl can do.