Showing posts with label perl. Show all posts
Showing posts with label perl. Show all posts

Install DBD::Oracle for Windows

Install DBD::Oracle for Windows


Recently i was in need to install DBD::oracle for windows so scoured google for it. Found that many people have trouble with installing the module.
Activestate site says:
Using PPM: "DBD::Oracle Oracle no longer provides the Oracle client libraries for free, so we can no longer provide DBD Oracle as a PPM/PPM3 module. The DBD-Oracle package for ActivePerl 5.6 is the last package compiled before the licensing changed that is still available on our site. If you wish to compile this module locally, the source may be obtained from www.cpan.org. Instructions on using CPAN are at: http://aspn.activestate.com/ASPN/Reference/Products/ActivePerl/lib/CPAN.html. If you are using Windows, an easy workaround for you might be just to use DBD-ODBC instead."


I encountered with following errors 
ppm install failed: The PPD does not provide code to install for this platform

Many suggested to use ftp://ftp.esoftmatic.com/, which is no longer exists.
Later found this site(http://www.cedet.dk/perl/). It gave me the solution to install DBD::Oracle for Active State Perl 5.8.x. But i am using perl, v5.10.0 built for MSWin32-x86-multi-thread.

http://trouchelle.com/perl/ppmrepview.pl is a good site with a whole lot of ppd repository.

Finally this helped me to solve the problem.
 

C:\>ppm install http://trouchelle.com/ppm10/unstable/DBD-Oracle.ppd
Downloading DBD-Oracle-1.22...done
Unpacking DBD-Oracle-1.22...done
Generating HTML for DBD-Oracle-1.22...done
Updating files in site area...done
  16 files installed


Point to be noted.
  • Dont use graphical interface(ppm) to install DBD::Oracle. Use install command from the command prompt.
  • Install oracle client. If still problem persists (error message like entry point not found) try replacing oci.dll

Want to try Catalyst

Catalyst is open-source perl based elegent MVC framework(http://dev.catalystframework.org/wiki/). Check out http://www.perl.com/lpt/a/930 to know more about Catalyst.

Lets see the steps to install catalyst in a easy way.


Download svndump.gz from http://handelframework.com/downloads/
Extract/unzip the items from svndump.gz



For windows:

open a command prompt
-------------------------
  • Goto -> Run->cmd


Change directory to CatInABox/bin
------------------------------------


> cd CatInABox/bin folder
Run catalyst.bat
----------------
Run catalyst.bat along with your Application name. Say my application name is 'Testapp', i would run


> catalyst.bat Testapp
















Now you are done with creating your application. To start the server, change directory to your Testapp/script and start the server.


cd Testapp/script

perl testapp_server.pl
Now your application is up and running. To view it. Goto browser and check
http://localhost:3000 . you should be able to view the application.
For unix flavors:
Repeat the same procedure for unix boxes. Instead of catalyst.bat use catalyst.pl


catalyst.pl Testapp
Which will create the same structure as in windows.



To create a TT view, run:
$ script/testapp_create.pl view TT TT
This creates the lib/Testapp/View/TT.pm module, which is a subclass of Catalyst::View::TT.



To create a new Controller, run:(say i am creating controller User)
$ perl script/testapp_create.pl controller User
This will create "/lib/TestApp/Controller/User.pm" and "/t/controller_user.t"dot(.) t files are used for testing.
To create a database Model
Before creating model, read: http://www.perlmonks.org/?node_id=700283
You need a database, it is recommened to use SQLite, if your application is small. Since its a "embedded" database. so the database exists as a single file and requires no server to run.
$ $ perl script/testapp_create.pl model TestDb DBIC::Schema \ Testapp::Schema::TestDb create=dynamic \ dbi:SQLite:/tmp/database