Gazelle - High performance PSGI Server

Gazelle is high performance PSGI Server, which have compatible with Sterlet by Auther kazeburo.

Gazelle(slide share)

Feature is:

  • Plack Handler / PSGI Server
  • HTTP/1.0 Web Server
  • Preforking Architecture
  • Sutable for running application servers befind a reverse proxy
  • Starlet compatible / hot deploy
  • Fast Fast Fast

Gazelle is very fast. Performance is as near fast as nginx(nginx is 1.2x) in slide share benchmark.

Day 8: Stopwatch (App::stopw)

About the series: perlancar's 2014 Advent Calendar: Introduction to a selection of 24 modules which I published in 2014. Table of contents.

Okay, this post couldn't be simpler. stopw (from the App-stopw distribution) is a very simple CLI program. When run, it displays a running stopwatch, upon which you can press Spacebar to let it move down one line (so you can see/note the time you pressed the Space), or Enter to pause/resume, Z to reset back to 0, or Q to quit. I'm almost shameful that it took my Perl code more than 100 lines to accomplish this (I think the teenager me from the 1980's would surely have been able to whip up this task in about 20 lines of BASICA/GW-BASIC).

I now try hard to remember why I needed this in the first place, but can't recall. Probably to time some subtitle, or a song that I listen on the radio, or to exercise holding my breath, or exercise my reflex. But probably not.

Anyways, there is an existing CLI stopwatch on CPAN before I wrote this: App::Stopwatch (which includes the stopwatch utility), written by BESSARABV. However, it doesn't show subsecond precision, and does not allow for many controls like pausing/reseting. Plus, the name clashes with the Debian package of the same name.

Of course you can `requires` attributes!

During the patch -p2 hackathon, two seasoned Perl programmers told me that "you can't requires attributes". This sounded weird to me, as attributes are exposed as methods and besides, I'm doing that all the time in my current work project.

Day 7: Set screensaver timeout from the command-line (App::SetScreensaverTimeout)

About the series: perlancar's 2014 Advent Calendar: Introduction to a selection of 24 modules which I published in 2014. Table of contents.

Here's the problem statement: For safety/privacy reason, I generally want my desktop screensaver to trigger rather quickly (say 3-5 minutes) to minimize prying eyes when I'm away or fall asleep and forget to lock. But when I watch videos, I want to set the timeout to a longer time (say the total duration of the videos plus 1 minute, or (better) 20-60 minutes which is the amount of time from I start the video until I doze off at night.

I used to have this line on my ~/.mplayer/config on my PC:

heartbeat-cmd="xscreensaver-command -deactivate &"

until I use a laptop with KDE plasma on it, which doesn't use xscreensaver by default. Plus I don't think disabling screensaver for the whole playback duration is sometimes not what I want (see above).

Test-Simple Release-Candidates

This is an update to the ongoing efforts to update Test-Builder. At this point the updates have been merged into blead, that means the new Test-Simple will be part of perl-5.22, barring any significant reasons to remove it. This post is to provide details you should probably know.

The changes have entered the release-candidate stage. The plan at the moment is to go stable if we have an entire blead-cycle without any significant changes needed. What constitutes a significant change? This is a grey area, obviously documentation, version number, and error message typo fixes are not significant. Logic changes on the other hand can be, at the moment I am relying on discussion with the toolchain-gang and the perl-qa group to make this call.

Pod::Readme can now be used with Dist::Zilla

I've recently released a new version of Pod::Readme with hooks to work with Dist::Zilla.

I also worked with Fayland 林 so that Dist::Zilla::Plugin::ReadmeFromPod will use Pod::Readme.

This means that you can use Pod::Readme's POD syntax in your module for generating README files. This includes the ability to:

  • Write POD sections in your module that are only shown in the README, such as the installation instructions, prerequisites, etc.;
  • Exclude other POD sections from the README, such as the details of functions and methods in your module;
  • Include the module's version, latest changes, or prerequisites in the README automatically;

You can also generate README files in alternative formats, such as POD, markdown or HTML.

Day 6: Think globally, act localizably (File::umask, Locale::Tie, Unix::setuid)

About the series: perlancar's 2014 Advent Calendar: Introduction to a selection of 24 modules which I published in 2014. Table of contents.

Local variables or dynamic scoping is a very nifty feature of Perl that nowadays do not exist in a lot of other languages. It allows you to temporarily set the value of a global variable during a block/scope during runtime, effectively localizing global variables. For example, even though some modules provide configuration settings as global variables, like Data::Dump's $INDENT, you can change the values of these variables without having a global effect by using local:

    local $Data::Dump::INDENT = ""; # disable indenting
    $res = Data::Dump::dump(...);
# here the value of $Data::Dump::INDENT is restored the original value

Day 5: Look ma, no 'argument list too long'! (App::rmhere)

About the series: perlancar's 2014 Advent Calendar: Introduction to a selection of 24 modules which I published in 2014. Table of contents.

If you spend enough time on a Unix/Linux shell, sooner or later you'll be faced with the task of removing files in a directory that contains a lot of those files (in my case, it's usually a Maildir with lots of spam/unread emails). The directory will contain so many files (like 50k or even millions) that doing rm * will fail with the annoying "Argument list too long" message because the * wildcard is expanded by the shell into a multimegabyte list that doesn't fit into the readline buffer. To delete the contents of this directory you will have to resort to some tricks, like using xargs -n, or going up one level, deleting the container directory, and later recreating it.

About is a common blogging platform for the Perl community. Written in Perl and offering the modern features you’ve come to expect in blog platforms, the site is run by Dave Cross and Aaron Crane, with a design donated by Six Apart, Ltd.