Forum Moderators: coopster & phranque

Message Too Old, No Replies

Convert PHP into Perl

PHP to PERL

         

nmventure

4:25 am on Aug 27, 2004 (gmt 0)



Hi all, another noobee here. I'm a sysadmin for a small company. Part of my job is writing server side scripts for a company intranet site that is built and run by employees of different departments. I've been using 100 percent PHP for these scripts for years and never did really have to use perl. Now we're purchasing a new webserver and the company wants ALL scrips done in perl - period. It's a hassle for me but also a good chance for me to finally learn perl. I ordered O'Rielly's perl cook book but since I haven't got it yet, I thought I would see if someone could convert a really simple PHP script for me so I can get an idea of what it looks like. Our old web server has been running Mandrake 9.1 and Apache 1.3. The new server will be Windows 2k or XP Server, and IIS which is also a big hassle for me but a totally seperate issue. Anyway, here's a simple PHP script - what would it look like in Perl? and Thanks......
-------------------
<?php

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Variables passed in from a form.........
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
$TOTAL = ($SUB1 + $SUB2) * $MARKUP;
$TODAY = date("I, F dS, Y);

echo "<html><head><title>Totals of submitted values</title></head>";
echo "<body>";
echo "<H2><FONT COLOR='NAVY'><I>Here is a table showing your order</I></FONT><BR><BR>";

echo "<table align=right border=3 bordercolor=navy cellspacing=2>";
echo "<tr>";
echo "<td>Unit Cost</td><td>$SUB1</td></tr>";
echo "<tr>";
echo "<td>Labor</td><td>$SUB2</td></tr>";
echo "<tr>";
echo "<td>Markup</td><td>$MARKUP</td></tr>";
echo "<tr>";
echo "<td><FONT COLOR='RED'>Unit Cost</FONT></td><td>$TOTAL</td></tr>";
echo "</table>";
echo "</body></html>";

?>

Brett_Tabke

8:53 pm on Aug 27, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



That is one of the easiest Perl script I've seen in ages.

A good beginner book on perl, or even some of the webs indepth articles is a good place to start.