Category: Perl

  • ActiveState Perl 5.10, Windows XP, and DBD-mysql

    A few months ago I installed ActivePerl 5.10 on a Windows XP Pro workstation. Next I tried to install DBD::mysql using CPAN, it failed. When I browsed modules via ppm, a GUI in this version of ActiveState Perl on Windows, DBD::mysql was not listed as an available module. I then downloaded the source code, manually […]

  • Quick way of finding version number of a Perl module

    Run this on command line [sourcecode language=”text”] perl -MMyModule -le ‘print “$MyModule::VERSION\n”‘ [/sourcecode] For instance, to find out the version number of DBI installed on the machine, run [sourcecode language=”text”] perl -MDBI -le ‘print “$DBI::VERSION\n”‘ [/sourcecode] To find out the version of DBD::mysql, run [sourcecode language=”text”] perl -MDBD::mysql -le ‘print “$DBD::mysql::VERSION\n”‘ [/sourcecode] One caveat: this […]

  • Perl script to convert MySQL character set to utf8

    “Groovy, baby!”, as international man of mystery likes to say. It seems converting character and text data to utf8 character set is a common task for MySQL, especially during an upgrade. In fact, I had trouble with it during server and WordPress database upgrade for this blog site. I wrote about it in this post, […]

  • Identify a proxy when automatic configuration script is used

    Many, if not all, corporations control and monitor employees web surfing and email activities. Sometimes a company may choose to use automatic configuration script to enable employees’ web connection. This can be verified by: Internet Explorer: Tools -> Internet Options-> LAN Settings -> “Use automatic configuration script”; Firefox 3: Tools -> Options -> Advanced -> […]

  • Move SQL Server backup file and restore it with Perl

    #There are two key parts for this script. The first part copies the latest backup and paste it in the local g drive. The second part do the restore from this backup file. It’s a LightSpeed backup and restore. Linchi Shea’s SQLDBA helper Perl files are needed. This is mainly for my own safekeeping. [sourcecode […]