Apr 9, 2007 #1 CIMTEET Programmer Jun 25, 2001 182 US Can perl use a cursor to access oracle databases on unix systems? I need to learn how to do two things quickly with perl: 1.Read an external text file 2.Parse and pass data to another file Are there any examples I could work with? Greg
Can perl use a cursor to access oracle databases on unix systems? I need to learn how to do two things quickly with perl: 1.Read an external text file 2.Parse and pass data to another file Are there any examples I could work with? Greg
Apr 9, 2007 #2 xmassey Programmer Apr 9, 2007 62 GB Hello, I am not sure if you are able to use an oracle database however I know that you can read and use information stored on an external file... For example To open and write to a file (i.e. logfile.txt)... open (LOG, ">>/YOURPATH/logfile2.txt") || Error('open', 'file'); flock (LOG, 2) || Error('lock', 'file'); print LOG " Hello\n"; close (LOG); Then to use what is written in the file (using variable @logmessages)... open (LOG, "/YOURPATH/logfile.txt") || Error('open', 'file'); flock (LOG, 2) || Error('lock', 'file'); my @logmessages = <LOG>; close (LOG) || Error ('close', 'file'); Now whereever you place @logmessages, the logfile will be printed (in this case the word "hello". Chris Upvote 0 Downvote
Hello, I am not sure if you are able to use an oracle database however I know that you can read and use information stored on an external file... For example To open and write to a file (i.e. logfile.txt)... open (LOG, ">>/YOURPATH/logfile2.txt") || Error('open', 'file'); flock (LOG, 2) || Error('lock', 'file'); print LOG " Hello\n"; close (LOG); Then to use what is written in the file (using variable @logmessages)... open (LOG, "/YOURPATH/logfile.txt") || Error('open', 'file'); flock (LOG, 2) || Error('lock', 'file'); my @logmessages = <LOG>; close (LOG) || Error ('close', 'file'); Now whereever you place @logmessages, the logfile will be printed (in this case the word "hello". Chris