Thursday, October 16, 2008

MySQL DBD in Activestate

I'm currently doing some consulting work to bridge the gap between Oracle and MySQL. Being in a Windows environment, I'm using the Activestate Perl distribution. Fortunately, it includes a nice ODBC module for connecting to Oracle out of the box. The bad news is, it doesn't contain a MySQL module. Luckily, I found a third party host that does provide the module. The following ppm (Perl Package Manager) one-liner takes care of the issue.

C:\>ppm install


Unknown said...

Good to see the post ratio go up! It will be nice when Activestate finishes porting over its modules to Perl 5.10. Although, I believe the DBD::MySQL module is available on Activestate for Perl 5.8.

Also, here is another potential tip for you:

If you have Vim running inside of a PuTTy or xterm session, doing:

:set mouse=a

will enable Vim to interact with the mouse. This will let you drag borders, visual select, and use the scroll wheel inside Vim, just like the gui version!

Ray Forrester said...

using the mouse is EVIL!!

Anonymous said...

I read through your backlog of posts and found this tip:

"Visual Block Change
In Vim, you can replace a selected portion of text across multiple lines with a new piece of text using a Visual-block change. As an example, highlight aportion of text across multiple lines using ctrl-v (blockwise visual mode), nowpress the "c" key to delete the selected text and enter insert mode. Type in some new text and press the Esc key. The text should be inserted for each row of the selection."

I'd like to add something to this; if you press I (shift-i) when in visual mode and having marked a block of text, you get to insert text at the line the cursor is placed, but after returning to normal mode, the changes to the line is made to all lines you had marked in visual mode! In short, this is can be seen as an "insert in block" technique.

I've met many people who doesn't know of this trick, so it's well worth telling about.

While I am at it, another little Vim-trick might be of interest. If you're on a non-Windows machine you can make the Vim hardcopy command print to a postscript file instead of a real printer. Try issue the following:

:hardcopy >

..and you'll get a postscript output of the file you're currently editing.

Happy vimming!

Anonymous said...

A slight clarification regarding my tip on inserting text in all lines of a block: You have to use the "visual block mode" (ctrl-v), this tip does not apply when in "visual line mode" (shift-v).