Suchergebnisse mit Tag „perl“

TOP

Speed up your script using profiling

What is profiling?

Each script should care of resources (time, memory or CPU time) being used, but some don't. Profiling is a detailed analysis of your script's behavior while it's running.

A profiler notices every processed line, it's callers and called functions and time required to process it.

Weiterlesen
TOP

When slower is better: Secure your passwords

It happend to PerlMonks, Sony and many others: A plain text password table was stolen from the database. Read this carefully to not become the next one on that list.

Weiterlesen
TOP

use Problems; with Exporter and import

The Exporter-module "copies" functions and symbols from a module into other files - but not reliable.
Weiterlesen
TOP

When PID is not enough: Unique Perl interpreter ID

A not so recent James Bond movie was called The PID is not enough (well, not exactly, but near by). The movie was good to watch but didn't provide a solution for real world problems: What to do if a PID is not specific enough, maybe because of threads?
Weiterlesen
TOP

Excel: Dateifehler: Daten sind möglicherweise verloren gegangen.

Microsoft Excel macht manchmal komische Dinge, in Verbindung mit einigen Internet Explorer Versionen wird die Meldung "Dateifehler: Daten sind möglicherweise verloren gegangen." ausgegeben wenn eine mit Spreadsheet::WriteExcel erstellte Datei angezeigt wird.

Weiterlesen
TOP

use, BEGIN and what's Perl doing with them

use-lines and BEGIN-blocks are not processed like they appear within a file.
Weiterlesen
TOP

(Don't) Panic: attempt to copy freed scalar 135c588 to 13767c0 at Carp.pm

A new problem appeared about a week ago: Perl paniced - something I've never seen before - with an internal error message "attempt to copy freed scalar". The problem occurred in Carp.pm which is a Perl core module.
Weiterlesen
TOP

Intelligent caching for alltime statistics

Statistics are important for many projects, but not all of them are easy to build. Many long-term stats involve heavy SQL queries and some may of these queries may also freeze database servers or tables. Caching intermediate results may limit these queries to a minimum.
Weiterlesen
TOP

Perl-Sünden

Den heutigen Tag habe ich gefühlt nur mit Bugfixes verbracht. Keine komplizierten, schwer zu findenden Bugs, sondern kleine fiese dumme Minikäfer die einfach nur nervig sind.

Weiterlesen
TOP

Hunting down a suspicious Perl error

I joined a commercial project lately which has been growing for years. Adding a "use" for a module which was called in source but not loaded by "use" before suddenly led some old coding sins show up. Torben and I spent two hours on finding and fixing this bug.
Weiterlesen
TOP

Programmieren mit sed

Funktionsnamen sind normalerweise Konstanten: Einmal festgelegt ist es quasi unmöglich sie zu ändern. Wird dies dennoch einmal notwendig können leicht einige Stunden oder Tage Entwicklungszeit notwendig werden.
Weiterlesen
TOP

Everything you missed: Perl weekly

Let's face it: Perl users love old versions. New Perl versions aren't unstable or bug collections but it takes (a long) time for them to reach the Linux distribution maintainers and most users prefer the default Perl installed by their operating system. Many of them don't know or just don't participate in the Perl community.

Weiterlesen
TOP

Setting up Perltidy with SVN

Developing the same source with more than one person isn't fun: Everybody has his or her own style and with Perl's TMTOWTDI these style may be very different. Perltidy reformats your source to one, common style but this could be very hard when using a versioning system like SVN or GIT.

Weiterlesen
TOP

Get server-side message-id or server response from Net::SMTP

Sending important mails leads sooner or later makes you search for your mails throughout the logs of your mailserver. Using the unique mail id assigned by the mail server makes things much easier.

Sending mails with Net::SMTP is pretty easy, but it won't show the server reply (containing the assigned transmission id).

Weiterlesen
TOP

Splice()ing a scalar

Scalar (text) processiong is easy using Perl, but things get a bit more complicated if you need to handle huge data. One of m tickets at work included a special scalar text variable today.
Weiterlesen
TOP

Perl syntax question: Boolean result?

A new task at work made me hunting warnings, mostly "Use of uninitialized value" messages. One simple line creating such noise was
my $country_href = $countries->{$setup{countrycode}} || 0;
Weiterlesen
TOP

Vier Tage ohne Blog

Hilfe, sind tatsächlich schon wieder vier Tage rum seit meinem letzten Post? Und jetzt habe ich noch nicht einmal etwas sinnvolles, was ich schreiben könnte...Schuld daran ist, wie Ihr vielleicht erahnen könnt, die Arbeit. Ich hatte angedroht, mich in selbige zu stürzen, wenn ich nicht zu Hause bin und genau das habe ich auch getan, zumindest wenn mich die deutsche Bahn nicht gerade daran gehindert hat.
Weiterlesen
TOP

Hunting a Padre bug

Padre is not only "some open source project I'm involved", but a tool I'm using for every day's work. Yesterdays "svn update" brought a new bug, files as ticket #1286. Hunting down a newline issue isn't that easy, because many things from Wx events, encoding, line ending up to keypress-events or intelligent code suggestion may have the bug.
Weiterlesen
TOP

Finishing Tie::Hash::MongoDB

The first part of this guide explained how to create the skeleton of the new module and how to create the backend for tie'ing a hash to a MongoDB document.

This second part will finish the job by putting some useful code into the skeleton methods.

Weiterlesen
TOP

Creating Tie::Hash::MongoDB from scratch using Padre

Perl's hash is very powerful, it stores any kind of data, but it's kept in memory and this is not always wanted. The powerful "tie" function binds a hash to a Perl module which could do whatever_it_wants with the data.

Today I'ld like to show you how easy a has could be connected to a database. A module which connects a hash to SQL is already on CPAN, so let's go with MongoDB.

Weiterlesen