Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Question for DBAs who use perl?
>>>>> "Ryan" == Ryan Gaffuri <rgaffuri_at_cox.net> writes:
Ryan> What do you use it for? Trying to decide whether I should spend Ryan> the time to learn the basics. Looks like its just a scripting Ryan> language that allows for file manipulation. Is there anything Ryan> in perl that I cant do with awk or with Korn easily?
Well, it is just another scripting language. However, it is a lot more powerful than awk or a shell like korn. One advantage is that you can do everything in perl you can do with awk, sed, grep cut, tr, sort, etc without ever leaving perl, usually in a lot less lines of code and you only need to remember the syntax for a single language.
Other advantages are that it supports subroutines with locally scoped variables, libraries/packages and even object oriented features. There is also a huge amount of available packages and libraries from CPAN - I've found most of the time, I've been able to locate a package which will do anything I needed - complex date arithmetic, querying/setting SNMP servers, retrieving data via http, ftp, ssh/ssl, tftp, nntp, etc. and often end up just writing a few lines of code to solve reasonably complex problems quickly.
One of the things often put forward about perl is that it "lets yo do it your way" - for example, if you like to code like
if (some_test) {
do_this
}
fine, but you could just do
do_this if some_test;
or instead of
open(HANDLE, FILE)
you could do
open HANDLE, FILE;
Essentially you can use perl in a way you like. The drawback with this is that allowing everyone to do things their own way can make large projects done in perl difficult to manage/maintain and it can be hard to work on code developed by others.
With respect to Oracle, I've found perl very handy when I have wanted to process files of data - PL/SQL is not very useful in this context, but perl can do it in just a few lines of code. Using packages/libraries of perl routines, you can get a nice uniform, powerful flexible toolset which can make it very easy to do a wide range of reporting and data manipulation or interface with other systems.
Tim
-- Tim Cross The e-mail address on this message is FALSE (obviously!). My real e-mail is to a company in Australia called rapttech and my login is tcross - if you really need to send mail, you should be able to work it out!Received on Thu May 01 2003 - 05:24:13 CDT
![]() |
![]() |