473,324 Members | 2,257 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

perl and php, horses for courses?

pc
hi all,

I have been blessed with the task of writing a web based database
representing the state of our globally installed isam databases.

there are basically four steps in setting this up:

1) schedule isam file reports to run at all remote sites. this
generates a text file describing the current state of tables (files) in
the database.

2) schedule an ftp job to pick up these text reports and dump them on a
central server

3) parse the reports and write the information to a mysql database

4) front end web based gui. make the information available (reports,
alerts, etc.)

Our company wants to use PHP for the front end GUI. Not having had much
experience with PHP it seems to me that the way to do the above would
be to do steps 1, 2 and 3 with Shell / Perl scripting (Perl being
designed for text file manipulation) and then to use PHP to provide the
GUI.

Anyone's thoughts and / or input on this matter would be much
appreciated.

cheers!

eddiec :-)

Jan 5 '06 #1
3 1401
On Thu, 05 Jan 2006 14:19:26 -0800, pc wrote:
Our company wants to use PHP for the front end GUI. Not having had much
experience with PHP it seems to me that the way to do the above would
be to do steps 1, 2 and 3 with Shell / Perl scripting (Perl being
designed for text file manipulation) and then to use PHP to provide the
GUI.


PHP can do pretty much anything that Perl can. OK, for some capabilities,
like reading/writing Excel spreadsheets and LWP, I would still go to Perl,
but text file manipulation can be done perfectly well with PHP.

--
http://www.mgogala.com

Jan 5 '06 #2
pc wrote:
hi all,

I have been blessed with the task of writing a web based database
representing the state of our globally installed isam databases.

there are basically four steps in setting this up:

1) schedule isam file reports to run at all remote sites. this
generates a text file describing the current state of tables (files) in
the database.

2) schedule an ftp job to pick up these text reports and dump them on a
central server

3) parse the reports and write the information to a mysql database

4) front end web based gui. make the information available (reports,
alerts, etc.)

Our company wants to use PHP for the front end GUI. Not having had much
experience with PHP it seems to me that the way to do the above would
be to do steps 1, 2 and 3 with Shell / Perl scripting (Perl being
designed for text file manipulation) and then to use PHP to provide the
GUI.

Anyone's thoughts and / or input on this matter would be much
appreciated.


Steps #1 and #2 could be simplified (and conserve bandwidth if that's
important) by using rsync on the remote sites. Not sure what OS your
remote sites are using but I'm pretty sure rsync is available for Windows.
Generate an MD5 for the file and send that to database feeder too. That
way it can check to see if the file it's about to load is valid/complete.

Step #3 could be done in PHP, but if you're more comfortable with Perl, then
knock yourself out. Populating a database is one of the jobs that seems to
lend itself to Perl/Python. Additionally, you could daemonize the
process/script so it detects when steps #1/2 have changed or added files
that need pumping into the database.

Decide on whether you want a fundamental push or pull model. Personally, in
these situations, I go for a push model: let the database populating
functions sit and wait for the remote sites to feed it data. This absolves
the db-feed-process of dealing with things like incomplete file loads or
bad network connections etc and makes it all a lot more reliable. Make the
remote sites do some basic validation like checking the whole file was
uploaded (rsync return codes), sending an MD5 sum for the feeder to verify
against, that sort of thing.

Have fun!

James
--
A musician, an artist, an architect:
the man or woman who is not one of these is not a Christian.
-- William Blake

Jan 5 '06 #3
pc wrote:
hi all,

I have been blessed with the task of writing a web based database
representing the state of our globally installed isam databases.

there are basically four steps in setting this up:

1) schedule isam file reports to run at all remote sites. this
generates a text file describing the current state of tables (files) in
the database.

2) schedule an ftp job to pick up these text reports and dump them on a
central server

3) parse the reports and write the information to a mysql database

4) front end web based gui. make the information available (reports,
alerts, etc.)

Our company wants to use PHP for the front end GUI. Not having had much
experience with PHP it seems to me that the way to do the above would
be to do steps 1, 2 and 3 with Shell / Perl scripting (Perl being
designed for text file manipulation) and then to use PHP to provide the
GUI.

Anyone's thoughts and / or input on this matter would be much
appreciated.

cheers!

eddiec :-)

You can write background jobs and shell scripts in PHP. They run from
the command line using PHP-CLI. Just type "php myscript.php" from your
shell.

I'm in the process of converting a bunch of Perl, .sh, and .vbs/.wsf
programs I had written awhile back to PHP, just so all my code is
standardized to one language and there is much less need for third-party
extensions/modules. (And, because I'm not good in Perl or bash, and
their documentation can not compare to PHP docs.) Try writing some text
manipulation programs in PHP and you will be pleasantly surprised.
Jan 6 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Bob | last post by:
As the title says, I'm looking to assess the advantages and disadvantages of Perl vs. PHP for web (cgi) programming. I'm a newbie at Perl, and a true novice at PHP but I have lots of other...
58
by: @ | last post by:
A benchmark in 2002 showed PHP is much slower in shell or when Apache has Mod_Perl. With the new PHP kissing Java's ass, Perl is once again the #1 CGI choice. Java is for a big team in short...
31
by: surfunbear | last post by:
I've read some posts on Perl versus Python and studied a bit of my Python book. I'm a software engineer, familiar with C++ objected oriented development, but have been using Perl because it is...
13
by: Jesse Thompson | last post by:
Greetings fell XML folk. I've just gotten started making SAX filters in Perl. I was hoping to build an XML templating engine this way, but the performance of XML::SAX::Expat and XML::SAX::Writer...
2
by: Ralph H. Stoos Jr. | last post by:
All, I have taken a company sponsored course in PERL taught by a fellow system engineer. He tried his best but, I am still an old dog and well.. that new tricks thing seems to apply. It...
1
by: Pieter Linden | last post by:
Hi, I think the subject line pretty much says it all... Say I have a students-classes database and I add a twist. I want to filter what courses a student can take by comparing the courses he...
2
by: Colin | last post by:
I have a table, which is a list of courses with a CourseID key field and about a dozen fields describing the courses. I also have a table that lists all of the students taught by one teacher, which...
0
by: Marian Heddesheimer | last post by:
Rent-a-Tutor.com is in search for testers as online-courses students. As operators of rent-a-tutor.com we are proud to offer high quality online courses over the internet at reasonable prices. At...
1
by: gordon | last post by:
Hi I have been using C# for a few months after reading a few books and I like to take my 'knowledge' to a more structured level. I am thinking about doing microsoft courses CSN2124 and...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.