Windows 7

time functions execute out of order

I ran this code both interactively and as a .py file:

import time
def a():
    print "starting"
    print "finishing"


My intention was to have "starting" print at the beginning, then a five second pause, then to have "finishing" printed.

Instead when I run the program, nothing happens for (a bit more than) 5 seconds, then "starting" and "finishing" print right after each other with no pause between them.

The same thing happened when I replaced the time.sleep(5) function with a handmade 5-second-pause function.

mysql + not EN characters

Hi, I'm using activeperl in win7 and have the following problem with MySql connection.

For a reason I can't select data when "where" clause contains some not EN characters. Returned data set is always empty. I tried to set mysql_enable_utf8=1 and unicode collation but with no success. The same script works properly with Strawberry perl. Could you please help?

Many thx in advance.

Trouble with PPM and @INC

I am installing the W3C Validator ( which I have done many times before.
It requires SGML::Parser::OpenSP which is only available in precompiled form for 5.8, and compiling it is very hard (because of some dependencies).

Introduction out of the way, I installed ActivePerl in C:\Webserv\ActivePerl\5.8.9\.
PPM and the CPAN command line are adding modules to .\site\lib instead of .\lib.
I changed the #! in the script to #!C:/Webserv/ActivePerl/5.8.9/bin/perl.exe -T
and Apache seems to be executing it properly, but I get this error:

idle closes immediately

I installed ActivePython 2.7 (32-bit) on a Windows 7 box (x64). When I run idle from the Start menu, idle closes its window immediately. If I run idle from a cmd box, it seems to run fine:

> cd \ActivePython27
> Lib\idlelib\idle.bat

Any thoughts?

can't uninstall ActivePython...

I did an uninstall of ActiveState python both 64 & 32 bit versions, and even a reboot, and installed the FOSS ( (2.7).

But oddly enough, when I run python (cmd line) I still get ActiveState python reported:
ActivePython (ActiveState Software Inc.) based on
Python 2.7 (r27:82500, Aug 23 2010, 17:18:21) [MSC v.1500 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> copyright()
Copyright (c) 2000-2010 ActiveState Software Inc.

Xml with perl


I have a large number of xml files in a folder. I want to read and extract the content of each xml file to a new.txt. I'm only interested in the content having the tag , and i want to create a .txt file (a texte file for each of my xml's). I use the perl modules xml twig and xml simple. There's the code i have until now:

my $xml_dir="C:\xmlperl";
my $output="C:\xmlperl\output.txt";
my $file = $ARGV[0];

opendir(DIR,$xml_dir) || die;

my @TranscriptsList = grep(/xml$/, readdir(DIR));

foreach $file (@TranscriptsList) {

PerlCritic Aborting - Magic Number checking failed

When I attempt to run my perlcritic-gui.exe, I am getting an abend with the error message:

Failed to obtain list of policies from percritic-dump Magic number checking on storable fiel failed at ..\..\lib\ (autosplit into ..\..\lib\auto\Storable\ line 398, at /<C:\Program Files\ActiveState Perl Dev Kit 8.0.1\bin\perlcritic-gui.exe>PDK/PerlCritic/ line 21

Does anyone have any idea what might need to be done to get PerlCritic to work?

Unable to Import my user created module

I built a module called "" and put it in the folder c:\pytemp .

I made sure that "c:\pytemp" was on the python path, and checked to see that it was in sys.path. It was the very first item after ''.

When I ran "import categories," I got the error "No module named categories"

I am new to the Python world, but it sure seems I followed the docs. What might work here?


Windows 7 error

Hi, trying to install a package on Windows 7 and suddenly a five minute task became an all day odyssey.

This is the error I get:

"All activated install areas are read-only. You cannot currently install or remove packages. Try enabling the uninitialized Areas in the Preferences dialog"

For some reason, Windows does not allow me (even running Explorer as admin) to change the ownership on "C:\Program Files (x86)\Perl\lib" to Full Control for my username.

Has anyone else experienced this?

Noob question


I am a newbie to Perl and I like to know how perl scripts are used. I do not see a .pl in the addressbar of the browser in most of the websites I visited. Are perl scripts run at the background? or if it is part of an html frame? What if I want to create a guestbook using perl? Is it ok to have a .pl as the extension of my webpage?

Thanks for the help...