Click to See Complete Forum and Search --> : learning Perl and running Perl script on WinXP Pro (IIS)


crmpicco
06-08-2006, 02:11 PM
Hi all,

Can i firstly say, i am a nooB to Perl.

I am looking to learn the language on my WinXP Pro (IIS) machine.

I was looking for a few tips or good links that some of you may know of.

Also, can i run Perl scripts on IIS without problems? if not, what do i need to do?

Thanks,
Picco

robertketter
06-09-2006, 09:10 AM
I am looking to learn the language on my WinXP Pro (IIS) machine.
Also, can i run Perl scripts on IIS without problems? if not, what do i need to do?

I have installed and ran Perl on several XP Pro machines. I always found it best to first get IIS running and make sure you can browse to 127.0.0.1 first. If all is well then next download Active-Perl from activestate (do a google) and install it following all instructions that are listed in documentation. Is should be working fine right out of the install.

Now... I have found it to be much easier to install apache server and forget IIS altogether. If you decide to install apache and perl you will be able to match the directory structure so you can build and ftp files onto your actual server on the net when you are done without making changes. Also a reall good text editor is a must and I would be more then happy to point you in the direction of the one I use. :)

Also one trick I like to use is to modify the hosts file on windows so I can type www.domain.com (actually replace "domain" with your domain name) and it will direct you to the website hosted at 127.0.0.1. This works really well and it allows you to view your website as if it were actually out on the net.

chrisranjana
06-12-2006, 12:47 PM
Here are a few tips on installing perl on windows (http://aspn.activestate.com/ASPN/docs/ActivePerl/5.8/faq/Windows/ActivePerl-Winfaq6.html).

crmpicco
06-19-2006, 09:00 AM
thanks to both,
i am trying to select data from my working MySQL database, called league. I have installed 'DBI' by going to the command line and typing 'ppm install DBI', now I am installing MySQL (ppm install DBD-MySQL).

what else do i need to do??

chrisranjana
06-19-2006, 09:14 AM
use DBI;

$dbh = DBI->connect('dbi:mysql:mydb','myuserid','mypassword');

$sql = "select name from tablename";

$sth = $dbh->prepare($sql);

$sth->execute || die "Could not execute SQL statement ... maybe invalid?";

#output database results
while (@row=$sth->fetchrow_array)
{ print "@row\n" }


taken from

http://www.freebsddiary.org/mysql-perl.php

crmpicco
06-19-2006, 09:37 AM
$anotherquery = $db->prepare("SELECT game_name, game_nick, category FROM staff") ;
$anotherquery->execute || die "Could not execute statement";

while (@row=$anotherquery->fetchrow_array)
{
print "@row\n<br>"
}

print "<table>";
print "<tr>";
print "<td>";
print ---- GAME NAME IN HERE ----
print "</td>";
print "</tr>"
print "</table>";



Thanks Chris, this is my code that i have ATM. How can i put the records into a table like I am trying to build with this code??? You know, have the game name in one cell, then the category in the next one???

Cheers,
Picco

chrisranjana
06-19-2006, 09:44 AM
You could use the perl module html template (http://search.cpan.org/~samtregar/HTML-Template-2.8/Template.pm).

crmpicco
06-19-2006, 12:40 PM
thanks chris, i can see where that module is going.

i was just curious as to what extent Perl is used in Web Applications. How would you describe the best usage of Perl? Its not really used for Web Development, i.e E-Commerce Websites like Expedia is it???

Picco