Perl

TOP

Connecting to Sybase ASE with Perl's DBI

CPAN has everything. Nearly everything and one of the modules is DBD::Sybase which connects to Microsoft SQL servers as well as Sybase ASE and iAnywhere servers, but there's a trick.
Weiterlesen
TOP

Session-Trouble

Why should I write about sessioning at all? A session is something which exists and should be as easy usable as possible. Is this the end of my blog post about sessioning?
Weiterlesen
TOP

defining undef

MS-DOS basic variants had fixed default values for variables, "empty" for string variables and "0" for numbers. DATABUS (now DB/C) variables used to have unpredictable content unless initialized with an empty value and Pascal - as far as I remember - also had default values. Perl doesn't distinguish between text and numbers but it has a default value for all scalars: undef.
Weiterlesen
TOP

Expensive join

How to concat an array into a string? Perl is TIMTOWTDI and I could imagine two common ways - but which one is the best?
Weiterlesen
TOP

Age check with Perl

Kids are discriminated for being kids. They're not allowed to smoke, drink alcohol and use various internet offers. but writing "not for kids" on a homepage barely fulfills legal and real life requirements, software has to calculate the age based on a known date of birth.
Weiterlesen
TOP

DBD::Sybase localization error for de_DE.UTF8

.Sybase ASE is one of my preferred databases and the Express Edition is freeware (thanks, Sybase!) but using the OpenClient driver on a plain German Linux installation issues some error messages:
Weiterlesen
TOP

Cronjobs on the Dancer floor

Did you find a typo in the title? No? You're right. I recently started to love the Perl Dancer Framework - and tried to write my first cronjob for a Dancer based project today.
Weiterlesen
TOP

4,3 billion people living in France

 

Look at the title and you're done. No need to add a text to this post if everything is said in the title. Not really? France is too small to hold half of the world's population? No way! My computer told me that 4.294.967.296 people live in France - and computers don't fail, you know?

Weiterlesen
TOP

Memory backup

Some weeks ago, I wrote a post about aggregated logging by merging many "UPDATE ... SET count=count+1" SQL statements into one. But there's a problem: All of the data stored in memory is lost if the task or server crashes or if the database dies and doesn't come back until the task exists. Here is how I solved this problem.
Weiterlesen
TOP

Where is your HEAD?

Most people would answer "on top of my neck" but that's not always right. Actually, most heads are above their bodies but not every head has a body - which usually is no problem. Trouble starts when someone asks for a head without a body. Headhunters do (but I don't care about them, at least within this post) and web-browsers also do from time to time.
Weiterlesen
TOP

Everybody is doing it

A co-worker asked recently me asked me: "Isn't Perl dead?" It isn't, many people and companies are using it, but no one talks about it.
Weiterlesen
TOP

Aggregating database updates

Statistics are nice, but may also increase database load. Counting web users (page impressions) may produce a lot of UPDATE requests setting counter=counter+1. I tried to merge them using Gearman.
Weiterlesen
TOP

YAPC::EU 2012 Videos

Vor einiger Zeit war ich auf der YAPC::EU 2012. Einige Talks wurden dort aufgezeichnet und endlich sind die Videos online- wenn auch leider von weniger Talks als erhofft. Hier sind meine Favoriten.

I visited YAPC::EU 2012 this year and some of the talks have been recorded. Finally, the recordings are online - much less than I expected, but here are my favorites out of them.

 

Weiterlesen
TOP

Perl MongoDB driver number handling

Perl doesn't care about numbers, integer or float - at least on the script level - but MongoDB does. The driver's default number detection algorithm treats floats as strings and MongoDB doesn't like to compare strings with less-than or greater-than operations.
Weiterlesen
TOP

Bottleneck file-I/O

Database load, disk, CPU and memory usage are known ressources on modern servers, but there is another one which is much more important: The I/O volume is limited and can't be raised as easy as all the others. It has no fixed limit and can't be measured (very good). It's a rare (maybe the most rare) good and shouldn't be wasted.
Weiterlesen