470,849 Members | 1,071 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,849 developers. It's quick & easy.

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 1283
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Bob | last post: by
58 posts views Thread by @ | last post: by
31 posts views Thread by surfunbear | last post: by
13 posts views Thread by Jesse Thompson | last post: by
2 posts views Thread by Ralph H. Stoos Jr. | last post: by
2 posts views Thread by Colin | last post: by
reply views Thread by Marian Heddesheimer | last post: by
1 post views Thread by gordon | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.