Thanks Shlomi, Will test your suggestion as soon as I get to the office in let's say .... 9 hours time ... it is 0050 now and got one more script to finish ... grrrr
BTW, like the fish on your site ... :-) On Thu, Apr 8, 2010 at 12:38 AM, Shlomi Fish <shlo...@iglu.org.il> wrote: > On Wednesday 07 Apr 2010 15:17:15 newbie01 perl wrote: > > Hi Rob and all, > > > > Thanks for all your response. They are all very helpful. Unfortunately, > am > > not in the office at the moment. > > > > I agree with your suggestion about hacking one of the OEM Perl script but > > that will be my last option in case I really want to use OEM's Perl > > install. > > > > > > Let me re-phrase my question for the time being. Let's assume that I will > > have to change @INC which is okay to do if I need to, but before I do, is > > there any way to verify that DBI is installed at all? Will the simple > > existence of the file DBI.pm enough to say that DBI is installed? > > As for the error message, it is very generic, that it cannot find the DBI > > module. The script is very simple as below: > > > > #!/<path_to_OEM's perl> > > > > use DBI; > > If you want your script to fail in case DBI cannot found do this. In this > case, the script will fail at compile time. If you want to test whether DBI > exists and if so use a fallback code, use something like (untested): > > {{{ > eval { require DBI ; }; > if ($@) > { > # Fail gracefully > } > else > { > # Yay! We have DBI. > } > }}} > > Hope it helps. > > Regards, > > Shlomi Fish > > > > > On Wed, Apr 7, 2010 at 12:16 AM, Rob Coops <rco...@gmail.com> wrote: > > > On Tue, Apr 6, 2010 at 2:06 PM, Shlomi Fish <shlo...@iglu.org.il> > wrote: > > >> Hi Chen, > > >> > > >> "newbie01 perl" has asked a question about Oracle and Perl 5/DBI. > Would > > >> you be > > >> able to enlighten them? (Everyone should note that Chen is an Oracle > DBA > > >> and a > > >> good friend of mine). Please hit reply all as the @perl.org mailing > > >> lists accept replies from non-subscribers and others may be interested > > >> in hearing > > >> that. > > >> > > >> Regards, > > >> > > >> Shlomi Fish > > >> > > >> On Tuesday 06 Apr 2010 14:47:16 newbie01 perl wrote: > > >> > Hi all, > > >> > > > >> > We currently have OEM installed but will have to uninstall it due to > > >> > Oracle Licensing issues. Customers do not want to pay > > >> > for the performance and diagnostic pack and are actually considering > > >> > to move to SQLServer .. :-) > > >> > > > >> > Anyway, am wanting to try out and install oracletool or orcaware. > Both > > >> > of these require the DBI/DBD module. > > >> > > > >> > At the moment, am not allowed to do another install of Perl. I > checked > > >> > the OEM's .pl Perl scripts and just wrote a simple Perl script > > >> > that has the use DBI; line on it and the full path to the Perl > binary > > >> > of the OEM install. Unfortunately, this does not work and the script > > >> > cannot find the DBI module. > > >> > > > >> > Am writing to ask if anyone had tried a similar thing that am trying > > >> > to do, that is use the DBI/DBD modules that comes with the OEM > > >> > install? > > >> > > > >> > Any response will be very much appreciated to those who had tried > > >> > this, whether it work or does not work. > > >> > > > >> > Thanks in advance. > > >> > > >> -- > > >> ----------------------------------------------------------------- > > >> Shlomi Fish http://www.shlomifish.org/ > > >> "The Human Hacking Field Guide" - http://shlom.in/hhfg > > >> > > >> Deletionists delete Wikipedia articles that they consider lame. > > >> Chuck Norris deletes deletionists whom he considers lame. > > >> > > >> Please reply to list if it's a mailing list post - > > >> http://shlom.in/reply. > > >> > > >> -- > > >> To unsubscribe, e-mail: beginners-unsubscr...@perl.org > > >> For additional commands, e-mail: beginners-h...@perl.org > > >> http://learn.perl.org/ > > > > > > So lets see the script and the error then :-) It makes it a lot easier > to > > > explain what is going on. > > > > > > But form my experience (never messed about with OEM my self), this > sounds > > > like a simple perl library issue. Your OEM program likely sets some > > > environment variables that point perl to the right path for the library > > > files. Writting your own script and simply calling the perl interpeter > > > that comes with OEM will not work as it will not have the environment > > > set correctly. > > > > > > What I woudl try is "hack" the OEM version of the perl script and have > it > > > print things like @INC and other environment variables that might help > > > you simply make it write a file to /tmp at the start of the script and > > > you should be fine. > > > > > > Then all you do is setup the same environment for your perl script and > > > you should be good to go. > > > > > > Regards, > > > > > > Rob > > -- > ----------------------------------------------------------------- > Shlomi Fish http://www.shlomifish.org/ > Parody on "The Fountainhead" - http://shlom.in/towtf > > Deletionists delete Wikipedia articles that they consider lame. > Chuck Norris deletes deletionists whom he considers lame. > > Please reply to list if it's a mailing list post - http://shlom.in/reply . >