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 […]
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.
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”‘
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 […]
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 […]
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 […]
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 […]
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 […]
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 […]
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 […]