Check DVD region code from command line

Is there a way to get DVD region code from command line (linux/ubuntu 9.10)?
I want to script this action and store the region code (and other data about DVD) in a log.

EDIT: I am looking for the info about media, not the drive.


Here is the source code of a project that claims to be able to get the code. I understand that it will not work in your environment but there seem to be some good references at the bottom of the page.