Tag Archives: Perl

I need to a perl script

rajeshkumar created the topic: i need to a perl script Hi , There is a file called test.txt what are all the different ways BEGIN: test 1 test 2 %%%%%%%%%% TEST TEST TEST test 3 END: need to grab all contents in between BEGIN and END: Regards, Rajesh Kumar Twitt me @ twitter.com/RajeshKumarIn rajeshkumar replied… Read More »

Create a flat file database using perl

scmuser created the topic: Create a flat file database using perl How to create a flat file database as shown below s.no name age city phone 0 hema 22 Calcutta 4312542 1 hema 21 Bangalore 2344345 2 ganesh 25 delhi 2445454 3 kartik 45 pune 4312121 4 santosh 25 Hyderabad 2254231 5 kumar 25 mysore… Read More »

Use Vs require in perl

scmuser created the topic: use Vs require in perl Hi, Whats difference between “use” and “require” in perl? rajeshkumar replied the topic: Re: use Vs require in perl use is done at ‘compile-time’ and require is done at ‘run-time’ (ie can conditionally load modules) Regards, Rajesh Kumar Twitt me @ twitter.com/RajeshKumarIn rajeshkumar replied the topic:… Read More »

Spit out warnings on uninitialized variables Perl

scmuser created the topic: Spit out warnings on uninitialized variables Perl How to Spit out warnings on uninitialized variables in Perl? rajeshkumar replied the topic: Re: Spit out warnings on uninitialized variables Perl #!/usr/local/bin/perl -w This will help you (really, it will force you) to write better, cleaner code. Adding the -w switch to the… Read More »

Installing Perl modules

rajeshkumar created the topic: Installing Perl modules Perl modules may be installed using the CPAN module or from source. CPAN method perl -MCPAN -e shell (to get an interactive CPAN shell) perl -MCPAN -e ‘install Time::JulianDay’ (if you know the name of the module, you can install it directly without interacting with the CPAN shell)… Read More »

Perl -MCPAN -e “install DBD::mysql”

rajeshkumar created the topic: perl -MCPAN -e “install DBD::mysql” I am getting following issues while running following command in Windows Machine… perl -MCPAN -e “install DBD::mysql” Error Regards, Rajesh Kumar Twitt me @ twitter.com/RajeshKumarIn

Connect to my MySQL database using Perl?

rajeshkumar created the topic: connect to my MySQL database using Perl? #!/usr/bin/perl use DBI; $database = “DBNAME”; $hostname = “DBSERVER”; $port = “3306”; $username = “DBUSERNAME”; $password = ‘DBPASSWORD’; $dsn = “DBI:mysql:database=$database;host=$hostname;port=$port”; $dbh = DBI->connect($dsn, $username, $password) or die(“Could not connect!”); $sql = “SELECT * FROM mytable”; $sth = $dbh->prepare($sql); $sth->execute; while(($column1, $column2) = $sth->fetchrow_array)… Read More »

Why we use ‘use strict’ in perl

scmuser created the topic: Why we use ‘use strict’ in perl Hi, Why you should ‘use strict’? what is the significant of “strict” in out module? rajeshkumar replied the topic: Re: Why we use ‘use strict’ in perl Whenever your program gets over a few lines long, definitely when you can’t view the whole program… Read More »

Why do you program in Perl?

scmuser created the topic: Why do you program in Perl? Why do you program in Perl? What are the advantages of Perl ovber python and other languages?