Returning to both Windows and Perl after something of an absence.
The XAMPP application stack is a quick way to get a web server, database and scripting languages onto a Windows box (& other platforms as well). I seem to remember that it was one of the very first one-click application server installers back in the mid-2000s.
Anyway, the version of Perl bundled in the current release (1.8.1) is broken from the point of view of adding new modules. There's a complex Google trail to be followed but the upshot is: it awaits fixing. It's perfectly usable as a script interpreter but when you try to add modules from CPAN it's missing required system libraries and tools.
The simplest solution is to install Strawberry Perl, which is a port of the language and it's supporting ecosystem to win32 or 64:
* install xampp
* install strawberry perl
* check your environment variables to ensure that strawberry's perl.exe is in the system path (by default: C:\strawberry\perl\bin - rather than inside C:\xampp somewhere).
* alter the shebang line of any cgi scripts you want to call on xampp's apache server to point at strawberry perl (by default at: C:\strawberry\perl\bin\perl.exe).
So your cgi scripts will still live in the location defined in xampp/apache (default: C:\xampp\cgi-bin) but they will call the strawberry interpreter instead of the bundled one.
This way, your can use the standard CPAN method of adding Perl modules from the command line (perl -MCPAN -e shell) and it will compile and install them into a location where they can be found by strawberry Perl (C:\strawberry\perl\site\lib) - i.e. it's INC path.
Showing posts with label Perl. Show all posts
Showing posts with label Perl. Show all posts
Monday, November 5, 2012
Saturday, February 21, 2009
perl one-liner
perl -e 'while(<*.png>){$n=sprintf("%02d",++$i,$_);rename($_,$n."frumpus\.png")}'
append an ascending number to all the files in a directory: ie "27frumpus.png"
append an ascending number to all the files in a directory: ie "27frumpus.png"
Monday, November 10, 2008
list installed perl modules
perl -MCPAN -e 'print CPAN::Shell->r '
oh yeah &:
"o conf init" inside of the MCPAN console to reconfigure (when the list of available mirror you picked proves to have been wildly over enthusiastic).
Thursday, May 29, 2008
DBD::Oracle gotcha
when only the 'best' will do, ie. Oracle & Solaris: you have install the Perl DBD::Oracle module but whenever you try to load it (or run 'make test' etc) libnnz10.so is not found.
Go and check Oracle.so - this is the library created by the DBD::Oracle compile:
ldd -s Oracle.so | grep libnnz
This is one of the Oracle libs that was installed with instant client - in the location that should be your Oracle Home. You will see from the ldd output that it's expected to be found somewhere like /usr/lib. So even though you've defined $ORACLE_HOME & $LD_LIBRARY_PATH - that's not where the shared lib is looking for a dependency.
just make a symlink:
ln -s $ORACLE_HOME/libnnz10.so /usr/lib/libnnz10.so - or whatever the paths that will make it visible to the Oracle.so.
Go and check Oracle.so - this is the library created by the DBD::Oracle compile:
ldd -s Oracle.so | grep libnnz
This is one of the Oracle libs that was installed with instant client - in the location that should be your Oracle Home. You will see from the ldd output that it's expected to be found somewhere like /usr/lib. So even though you've defined $ORACLE_HOME & $LD_LIBRARY_PATH - that's not where the shared lib is looking for a dependency.
just make a symlink:
ln -s $ORACLE_HOME/libnnz10.so /usr/lib/libnnz10.so - or whatever the paths that will make it visible to the Oracle.so.
Subscribe to:
Posts (Atom)