-
Test for available modules in Perl
As I mentioned earlier the difference between use and require is that the second is evaluated only at execution time, making it possible to test if a given module was imported successfully. One possible use for this is to make your script deployable on multiple machines where you might or might not have the option…
-
Perl split gotcha
One of those things which are spelled out in the documentation, but most people (including myself) don’t really read the fine manual, until really, really forced to, and from the way it’s described, it’s not immediately clear how it can byte you. From perldoc: Empty trailing fields, on the other hand, are produced when there…
-
The difference between use and require in Perl
Contrary to PHP (if you ever used it), require is the more dynamic one of the two. Both statements are used to import modules, however use is executed compile time (ie when the parser runs through the script), and require is executed when the actual line is evaluated. Generally speaking you should use use (:-)),…
-
An alternative for Perl heredoc’s
Perl has (true to its motto – there more than one way to do it) many methods for declaring string. Here are a few: The single quote (‘) – does not interpolate variables, does not understand escape sequences (like n for newline) The double quote (“) – interpolates variables (replaces $foo with the value of…
-
An argument (against) PHP
Via Perlbuzz I landed at the blog posting An Argument for PHP, which I disagree with. First a little about my background: I’ve been programming in PHP almost twice as long (6+ years) as in Perl, so (hopefully) it isn’t the case that I don’t know what I’m talking about. PHP seemed nice and shiny…
-
All the perl documentation
A quick note: When I talked earlier about turning off warnings in Perl, I referenced the perldiag page. If you wish to see a list of all the perl… documentation available, you can look at the language reference at perldoc.perl.org (there is also a 5.8.8 version if you haven’t upgraded yet, although the differences should…
-
My Perl blog – how to turn off warnings
There seems to be a meme going around which encourages blogging about Perl. So here is my contribution: When you write scripts, it is really, really recommended to use the strict and warning pragmas (eventually diagnostics): use strict; use warnings; use diagnostics; #mainly for debugging, to better understand the messages I can’t tell you how…
-
Finding the installed files for modules in Perl
First of all if you want to quickly find out if a Perl module is installed on a system or not, you can do the following: perl -e”use Foo;” If the module is installed, this won’t print out anything, however it it isn’t it should say something like (yes, shame on me, I haven’t upgraded…
-
A small warning about ptkdb
ptkdb is a GUI debugger (as opposed to the default console-based one) for Perl using the Tk toolkit for its windows. As far as I know it is one of the most advanced ones, discounting debuggers built into IDEs. An other advantage of it is its availability for many platforms (including Windows), including sources like…
-
Unofficial VirusTotal uploader
Update: this script has been update and renamed to OVScan. Please use the new version. VirusTotal is a free service offered by Hispasec systems which scans the submitted files with a large number of AV engines (currently more than 30) and shows you the result. Disclaimer: I have no affiliation with them or any other…