jitender has asked for the wisdom of the Perl Monks concerning the following question:

Hi, I have downloaded Orapelr.pm file and added under lib folder. / in Perl folder i have .cgi files, how to include Oraperl.pm file .cgi file?
../perl/
hello.cgi
../lib/
Oraperl.cgi

Regards!
Jitender
  • Comment on how to include Oraperl.pm module in CGI file

Replies are listed 'Best First'.
Re: how to include Oraperl.pm module in CGI file
by marto (Cardinal) on Sep 12, 2018 at 06:25 UTC

    Oraperl documentation describes how to use it within modules, which differes if you are using it within perl 5 or old Oraperl scripts (you don't tell us what you are working with). If you are starting something new I'd suggest you just use DBD::Oracle (which you should have installed anyway as a prerequisites for Oraperl). As a side note, if you are building something new you should read CGI::Alternatives.

    Update: fixed typo, too early in the morning for me :P

      Thanks for your reply,
      if i am using

      use DBI::Oracle

      in hello.cgi file then i am getting error below

      Can't locate DBI/Oracle.pm in @INC (you may need to install the DBI::Oracle module) (@INC contains: /etc/perl /usr/local/lib/i386-linux-gnu/perl/5.22.1 /usr/local/share/perl/5.22.1 /usr/lib/i386-linux-gnu/perl5/5.22 /usr/share/perl5 /usr/lib/i386-linux-gnu/perl/5.22 /usr/share/perl/5.22 /usr/local/lib/site_perl /usr/lib/i386-linux-gnu/perl-base .) at admin.cgi line 35.
      already DBI module is installed in root directory.
        use DBI::Oracle

        DBI::Oracle isn't a module which exists on CPAN. See the copious documentation on DBI for how to use this abstraction layer or indeed the canonical book.

        PS. I've also just spotted this old but good introductory overview to DBI which might be a useful starting point.

    A reply falls below the community's threshold of quality. You may see it by logging in.