aufa has asked for the wisdom of the Perl Monks concerning the following question:

Hi all. I am new here. I am not a computer scientist by training. However, due to the needs of my current research, I start to use perl to extract data from internet. So, basically, I am a really beginner in language programming in general, and perl specifically. Currently, I use strawberry perl and open perlID. When I tried to execute one program (this program use LWP module), the open perlID always execute the perl5db.pl first. Everytime this perl5db executed, it always fail and the compilation is aborted. The error message is :
BEGIN failed--compilation aborted. Compilation failed in require at C:/strawberry/perl/lib/Win32.pm line +8. BEGIN failed--compilation aborted at C:/strawberry/perl/lib/Win32.pm l +ine 82. Compilation failed in require at C:\Users\aufa doarest\Desktop\Perl/pe +rl5db.pl line 435. BEGIN failed--compilation aborted. Compilation failed in require. BEGIN failed--compilation aborted."
To summarize, It seems that in order to run any program using this LWP module, the perlID need to execute perl5db.pl first. My open perlID always fail to excute this perl5db. Can anyone help me to figure it out how to do solve this? For information: I use Windows Vista 32 Bit. Best

Replies are listed 'Best First'.
Re: Failed to execute my perl program on open perlID
by Marshall (Canon) on Nov 26, 2009 at 15:50 UTC
    I am likely to disagree with some Monks. But it appears to me that you don't need the "latest and greatest" and do not need to fiddle around with strawberry.

    I would use ActiveState Perl for your app. Go to http://www.activestate.com/downloads/. These folks are often 1-2 years behind the curve in terms of packages, but I think that stuff from 2 years ago will work just fine for you!

    Whatever you do, stop this Windows thing of spaces in the file name! This just causes heart ache and grief. Instead of directory "aufa doarest", in "My Documents", make a directory C:\doarest and put your programs there. Never use a space in a Perl file or path name, put _, underscore instead of a space.

    I don't know what PerlID is. I think forget it. There are wonderful "standard", well debugged modules like Mechanize that can do what you want. Use modules that lots of other people use and you will get lots of help.

      While in general eschewing spaces in file names and paths sounds like a laudable goal from a lazy (Perl?) programmers perspective, in the OP's case the space is in a system provided path and is unavoidable. A far better thing would be for systems to provide the tools to work correctly with the practices people actually use.

      Windows has far too many special characters that can't be used in file names and paths and the mixed blessing of a case insensitive but (mostly) case preserving file system. On the other hand, so long as you remember to double quote file names if you are using the command line, it mostly does what people expect. Use of easy to read descriptive file names is the norm and applications generally cope.

      *nix on the other hand allows virtually anything in file names and paths, but general practice is to use short lowercase unpunctuated names without spaces. I find it vastly amusing that the file system that allows the greatest freedom in file naming is used in the most constrained fashion. *nix applications I've encountered are much more likely to be fragile in the context of allowed but unexpected file names than Windows applications.


      True laziness is hard work
        On Windows, the path name to Perl is "controllable". Module names, etc are "controllable". By "controllable" I mean that this path can be specified at installation time. The path to user data is not "controllable" and the Perl code should work with any Windows path name to user data.

        Unfortunately there are some "landmines" to be tripped over when trying to use the Windows "spaces allowed" names with Perl installation, library paths, module names,etc. I wish it wasn't so. I merely suggest that Windows users try to avoid installing their version of Perl into paths with spaces. This is a "your mileage may vary" situation.

        I also find some of the *nix file name glitches amazing. I find more problems with Windows now, but that is just because I use it more not that *nix doesn't have problems too!

Re: Failed to execute my perl program on open perlID
by Anonymous Monk on Nov 26, 2009 at 13:40 UTC
    What is open perlID? I would start > run > cmd.exe
    C:\>C:\strawberry\perl\bin\perl.exe myprog.pl