September 2006
Monthly Archive
Entertainment& Personal15 Sep 2006 11:07 pm
How appropriate, you fight like a cow!
I missed out on lots of good video games being a Mac/Sega guy, but I really should have played ‘The Secret of Monkey Island‘ long before now. Comedy really doesn’t seem to be done in new games too much now days, which is a pity (though understandable given that it’s pretty difficult to pull off without making a game seem too linear).
Anyway, some friends are having a pirate theme party tomorrow in honour of International Talk Like a Pirate Day (later in the week - September 19th). As part of my costume, I made up a “I found the treasure of Mêlée Island™ and all I got was this stupid T-Shirt” T-Shirt, which I thought I’d mention here, since I doubt anyone at the part will actually remember/get it.
Technorati Tags: games, pirate, the secret of monkey island
Perl taint mode and cmd.exe
I’ve been running into some problems porting a perl based CGI program from Linux to windows lately. The key issue is that when running perl in taint mode, you must set the PATH environment variable to some known string prior to doing anything which executes another common (exec, system, backticks etc.). The problem is that clearing the path means that perl is then unable to find the cmd.exe shell when running on Windows.
I’m not all that up on Windows programming in perl, but it seems that adding in any particular path (say C:\WINDOWS\system32) isn’t likely to work if Windows is installed in some unusual location. Unfortunately avoiding the shell processing (by passing a list of arguments to system or exec rather than a string) isn’t looking like it’s a viable option either, at least in the short term, so I’m more or less stuck.
I’m sure there’s some sort for clever trick for solving this, but Google has not turned up anything obvious. Perhaps, as a last resort, there’s some way to find out where Windows is installed through the registry?
Update
Thanks to Victor for his suggestion about the registry. What I ended up doing was looking at the SystemRoot environment variable with some code along the lines of the following.
delete @ENV{qw(IFS CDPATH ENV BASH_ENV PATH)};
if ($^O =~ /win/i) {
# Perl must be able to find cmd.exe, so add
# C:\WINDOWS\system32 to the path
$ENV{'SystemRoot'} =~ /([A-Z]:(\\[A-Za-z0-9_]+)+)/;
my $system32_dir = catdir($1,'system32');
$ENV{'PATH'} = $system32_dir;
}
exec($command);
If anyone has suggestion, or just knows for a fact that this will fail in some case, please let me know (in the comments).
Technorati Tags: windows, perl, cmd.exe, taint
Impro10 Sep 2006 11:41 pm
Impro Theatre ACT website
After a good year or so of talking about it, we finally got around to knocking up a website for Impro Theatre ACT. To be honest, I’m a little surprised we got the impro.com.au domain name.
There’s certainly some work to do on it content wise, and hopefully a bit more polishing of the colours and the html code itself, but all in all I rather like the design (not too much of a shock, since I did most of the underlying html work).
Sometime soon there should be a way to sign up to the mailing list to hear about upcoming shows etc. In the short term, I’m sure everyone’s looking forward to Impro Retro, on the 24th of September - 7:30 pm at the Street Theatre.