English

TOP

Perl bits: Passing @_ to a subroutine

Perl subroutines may be called with or without leading & and with or without () at the end. Either one is strongly recommended - the command might end up as something else than a function call if both are missing.
Weiterlesen
TOP

DESTROY or __DIE__ - choose one

Some people always complain, even about the language they've been working with for years while they has other options. One of them recently complained that Perl cleans up objects in unpredictable order during global destruction (after exit; and all END blocks). Here is what happend, how we tracked it down and solved it.
Weiterlesen
TOP

Compressing test for short strings

Data is getting bigger and bigger as technology advances. We didn't even think about using something inefficent like XML when I started writing sourcecode on a Datapoint 6600 or even in MS-DOS world, but today? A meg more or less doesn't matter today. But sometimes space is still premium and so it is for my current project. I'm working with short strings (text plus some extra chars, about 6 bit  per char) and they should be compressed.
Weiterlesen
TOP

Speed up Wordpress StatSurfer plugin

I'm using the WordPress plugin StatSurfer for quick dashboard statistics, but it's getting slower and slower while my blog is getting older.
Weiterlesen
TOP

Using Memcache for session storage

We started using Memcache for a project some time ago and the sessions of our web users had been one of the first functions using it. Here is how to use Memcache to reduce database load and speed up your websites.
Weiterlesen
TOP

The truth about DBD::mysql's bind values

SQL has some drawbacks, the worst one might be the SQL injection chance. There are many ways to avoid them but few of them are really working, one of them is using bind values by replacing all values by ? and passing the real values at execution time.
Weiterlesen
TOP

mySQL left the party (2006 'MySQL server has gone away')

mySQL servers have their own mind and sometimes just disappear. They go away from a client leaving it alone if the complete server is dying, if a client is doing unexpected things and sometimes even without any known reason.
Weiterlesen
TOP

New Highscore: Bloons Tower Defense 4

Yes, it's true, I'm playing games. Rarely but I do and usually they're simple flash games like Bloons Tower Defense 4 which is my current favorite (and only) game.

Weiterlesen
TOP

Using Memcache as database locking helper

Race conditions are nice: Two (or more) tasks are fighting for the same thing at the same time. Row locking on the database may help to avoid such races but only if the database supports them.
Weiterlesen
TOP

Parse both GET and POST data in the same request using CGI::Simple

The Perl CGI module is commonly used, but it's heavy. CGI::Simple is more lightweight but lacks some features. Here is a feature not supported by CGI but by CGI::Simple.
Weiterlesen
TOP

Happy Birthday myself!

Dieser Artikel ist etwas besonderes. This post is something really special. Er ist nicht besonders lang, interessant oder schön geschrieben, aber trotzdem einmalig. It isn't the longst, most interesting or best written post, but it's very unique. Es ist mein - soweit ich mich erinnern kann - erster zweisprachiger Artikel. This is my first dual-language post, as far as I remember. Aber vor allem ist es mein erster Geburtstagsartikel und dabei habe ich noch gar nichtt Geburtstag. But much more important - this is my first birthday-post -  but it's not my birthday.
Weiterlesen
TOP

Setting up Gearman

I recently announced an article about Gearman, today I'ld like to start with setting up a Gearman dispatcher server.
Weiterlesen
TOP

Web-Multitasking: Whos gonna work for the working man?

Web scripts usually do one thing at a time which is quite good as long as there is not too much to do. But serving thousands of request per minute with thousands of source code lines per request starts getting challenging. Bon Jovi asked for help for web scripts some time ago by writing his song "(Whos gonna) work for the working man". Well, there are little chances that he had something else in mind, but who cares.
Weiterlesen
TOP

Don't use exec and database connections

Typical Perl scripts (and others running as CGI-scripts) run and exit once they're done, but this isn't very efficient with medium or high request counts. Persistent solutions like FCGI and ModPerl avoid the additional interpreter loading and compiling phases, but start being challenging if any source file is changed.
Weiterlesen
TOP

Order your checks

Doing many checks may slow down a program, but sorting the tests may improve your program's speed a lot at a very low cost.
Weiterlesen