Thanks but I need it from within perl, the code for printing the result is actually a function that is called from another perl script and not a script by itself.
It's a part of a command line shell I wrote, and when a user enters the command
lessOnDB the function is called and the output should be displayed. So I need a stict perl way for doing that.