Jan 22 2012

Generate a unique ID for your image scans, with Data::Uniqid

Tag: Uncategorizedtengo @ 9:46 am

When I scan images, or paper notes, I like to leave a short note on the document I scanned referrring to my scanned digital copy of it. For example, when I scanned an image, I note on the back of it that this one is already scanned and I don’t have to rescan it over […]


Jan 15 2012

RegEx to match YouTube IDs

Tag: Uncategorizedtengo @ 5:25 am

This regular expression here can be used to match YouTube IDs:
$youtube_url =~ /watch\?v=([\w-]{11})/;
In words: \w: match any alphanumeric chars including _ (the dash), means letters, numbers; also match - (the minus); match eleven chars.It ignores further url query parameters.


Aug 12 2010

Show current version of an installed cpan module

Tag: Uncategorizedtengo @ 3:58 am

Often, you may ask yourself what version of a specific perl cpan module you’ve got installed on your system. So here is how to find out what version a perl module is, as an example on CGI.pm:
perl -e ‘use CGI; print $CGI::VERSION.”\n”‘


Mar 03 2010

WxPerl: Converting images for use as embedded XPM in your Perl code

Tag: Application Designtengo @ 5:51 am

Writing applications in Perl with WxPerl for GUI layout is nice. Decorating your apps with images is even nicer. Now when you go the extra mile to package your apps as compiled binaries, it can be regarded as messy to have the used images as external dependencies outside your code.
One solution around this is to […]


Nov 25 2009

Resolving a “print() on closed filehandle” error

Tag: Uncategorizedtengo @ 9:50 am

Today I banged my head for a few minutes against a strange error: I got a print() on closed filehandle from a simple code passage:
open(my $out,”>>”, “/some/file”) or die “File error: $!”;
print $out “sometext\n”.
close($out);
Can you spot the error?
After reading through two good help threads here and here, I came to the insight that something […]


Mar 19 2009

Crypt:SSLeay install problem under StrawberryPerl

Tag: setuptengo @ 11:50 am

A minute ago I had problems running the cpan install of Crypt::SSLeay under Windows + StrawberryPerl:
cpan -i Crypt::SSLeay
Before I tried the cpan module install I downloaded and installed openssl and Microsoft Visual C++ 2008 Redistributable Package. When cpan asked me where I installed openssl I pointed it to the right directory, but still - whenever […]


Mar 16 2009

How to feed query string values to a script on command line

Tag: Uncategorizedtengo @ 8:03 am

Often while debugging nasty “500 Internal Server Errors” and when everything seems to work on command line but the webserver refuses to properly serve your script’s output (btw: check if you set permissions right, twice!) you might want to feed the query_string to a script on command line. Running a script in default mode, without […]


Mar 12 2009

CPAN and Wx on StrawberryPerl, problems resolved

Tag: setuptengo @ 4:43 pm

Shortly after learning about StrawberryPerl (which I documented in my post about it as replacement for ActivePerl) I was tempted to actually try it. Well, tempted…, more like forced to try it. A script I am developing needed HTTP::Proxy and I was just unable to fetch it/get it working in the ActivePerl environment - even […]


Mar 03 2009

Simple mbox eMail reader in Perl

Tag: Application Designtengo @ 7:56 am

Although the email protocol (RFC2822) is one of the oldest of all the “Internet protocols”, getting perl to handle it is actually not that simple at first. Heading over to cpan it took me some minutes and a prototype script to get it do what I thought would be a one-liner.
My scenario was that I […]


Feb 27 2009

Wx::Perl lessons learned

Tag: Uncategorizedtengo @ 1:04 pm

WxPerl (Wx::App on cpan) is a great tool to design visually rich graphical user interfaces for your scripts. But the downside is that the learning curve is quite steep. There were many incident when I was banging my head against the wall for hours until I finally got what I intended. This post is meant […]


Next Page »