HOWTO: Create a Perl Shortcut That Acts Like a Drop Target In Windows

27 October 2005

UPDATE: I recently installed ActivePerl 5.6.1.638 on a new Windows XP system, and I did not need to take any special actions to make perl scripts into drop targets. YMMV.

If you use perl on Windows, you've probably got at least one script that you'd like to be able to put on your Desktop and drag-and-drop files onto to perform some function on the dropped files. There are at least two ways to accomplish this.

  1. If you've installed Active State Perl, every perl script with the ".pl" file extension on your system is associated with perl. You can make every one of these perl scripts a drop target by creating a Drop Handler as follows: Create a new registry key "shellex" under the "HKEY_CLASSES_ROOT -> Perl" key with a default value of {86C86720-42A0-1069-A2E8-08002B30309D}. You can do this manually, or save and run this .REG file to modify your registry automatically.
  2. Alternatively (or in addition), you could create a shortcut to Perl and add the path to the perl script as an argument, e.g., in the "Target" field of the shortcut properties, type "C:\Perl\bin\perl.exe" "\PATH_TO_YOURSCRIPT\YOURSCRIPT.pl". The shortcut will automatically be a drop target whether or not you implemented the registry change above. (You could also create a shortcut to wperl.exe, rather than perl.exe, and eliminate the DOS box.)

Trackback Spam

30 August 2005

As of its most recent version, b2evolution has a problem with trackback spam. Several b2e users (including Whoo and Graham) have suggested renaming the directory that contains (among other things) the trackback script. In theory, this should eliminate spam from bots but should not effect legitimate commenters and pingers.

Here's a perl script I wrote to automate Whoo and Graham's suggestion: hidehtsrv.pl. I suggest creating a cron job to run hidehtsrv.pl periodically. Note: this script requires another of my perl scripts, randpass.pl, a pseudo-random string generator.

Here's a b2evolution forum thread about trackback spam, and here's a b2evolution forum thread about why renaming is effective.

See also my post about comment and referrer spam and my b2evolution forums post about this solution.

Categorylist Modification

3 May 2005

I modified the categorylist plugin for Blosxom. Now it only lists a category if there are posts in that category. I've created my category taxonomy (tentatively) before I've posted in every category, and I don't want a slew of links to (0) posts. Here's a diff of my modification.

Writeback Plus Modification

2 May 2005

I made a couple of modifications to the Writeback Plus plugin for Blosxom. Here's the diff file. Basically, I wanted to have the ability to have alternative writebacks display with a shaded background. In addition, I fixed the removal of the builtin trackback flavour. And I also fixed the annoying always plural usage of "writebacks" (i.e., "1 writebacks") -- the method was taken from Pollxn.