![](/i/fill.gif) |
![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
I'm looking at doing some CGI scripting, where I would be retrieving data from a
SQL database, running some imperative commands (preferably with support for
custom objects / classes, as that would make things tremendously easier) and
then sending results back to a separate database.
The only scripting experience I really have in web pages is with PHP and JS; PHP
seems more geared towards HTML output than anything else, and JS is client-side
(while I need the scripts to be run server side).
I'm looking at Ruby, but since this is something I don't have much experience
with, I'd like to know what others here recommend. Any thoughts?
....Chambers
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Chambers wrote:
> I'm looking at doing some CGI scripting, where I would be retrieving data
> from a SQL database, running some imperative commands (preferably with
> support for custom objects / classes, as that would make things
> tremendously easier) and then sending results back to a separate database.
>
> The only scripting experience I really have in web pages is with PHP and
> JS; PHP seems more geared towards HTML output than anything else, and JS
> is client-side (while I need the scripts to be run server side).
Why not PHP? I have written many non-HTML scripts in PHP, including an IRC
bot or two (long-running daemons), and a script that scrapes a search page
to find spam and sends the needed POSTs to delete it. Although, of course,
neither of those two were run through a web server. "php deletespam.php"
And here's a script to resize JPEG images to half their size, also to be run
from a console and not from a browser/webserver: http://codepad.org/miaXuEIM
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
"Chambers" <bdc### [at] yahoo com> wrote:
> I'm looking at Ruby, but since this is something I don't have much experience
> with, I'd like to know what others here recommend. Any thoughts?
I like ruby. It feels like a mix of the very best of Perl, Smalltalk and Scheme
under one clean (almost python-clean) syntax. It also got the powerful and easy
Rails web framework, but you might be just as well served by the builtin
facilities for http in the stdlib.
PHP is web scripting's powerhorse, but it's butt-ugly.
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Nicolas Alvarez <nic### [at] gmail com> wrote:
> Why not PHP? I have written many non-HTML scripts in PHP, including an IRC
> bot or two (long-running daemons), and a script that scrapes a search page
> to find spam and sends the needed POSTs to delete it.
I wasn't aware that PHP had full class / object support; looking it up, I see
that I was mistaken.
I'll try working this out in PHP.
....Chambers
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Chambers wrote:
> I'm looking at doing some CGI scripting, [ ... ] PHP
> seems more geared towards HTML output than anything else,
What is the relationship between CGI and the behavior of your scripts? Or
are you using CGI to mean something other than "common gateway interface"?
I.e., why do you want to avoid HTML in the context of serving web pages?
That said, PHP works just fine without running as CGI. Beware that you
properly clean up anything that loops over records - it's not intuitive in
PHP when it actually disposes stuff you've pulled from the database, so
looping over a few million records will likely fail.
--
Darren New, San Diego CA, USA (PST)
Human nature dictates that toothpaste tubes spend
much longer being almost empty than almost full.
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Darren New <dne### [at] san rr com> wrote:
> That said, PHP works just fine without running as CGI.
I think PHP works just fine running as CGI as well.
--
- Warp
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Warp wrote:
> Darren New <dne### [at] san rr com> wrote:
>> That said, PHP works just fine without running as CGI.
>
> I think PHP works just fine running as CGI as well.
Indeed, to the extent that one likes PHP at all. But writing CGI scripts and
complaining that your language generates HTML output seems to imply there's
a confusion somewhere, either in the speaker or the listener.
--
Darren New, San Diego CA, USA (PST)
Human nature dictates that toothpaste tubes spend
much longer being almost empty than almost full.
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Darren New <dne### [at] san rr com> wrote:
> Chambers wrote:
> > I'm looking at doing some CGI scripting, [ ... ] PHP
> > seems more geared towards HTML output than anything else,
>
> What is the relationship between CGI and the behavior of your scripts? Or
> are you using CGI to mean something other than "common gateway interface"?
Actually, I just need an app to be run by the server, at the request of certain
web pages. The output could then be retrieved by other web pages.
CGI is merely an easy way to link the web pages and the apps that need to be
called.
> I.e., why do you want to avoid HTML in the context of serving web pages?
It's not that HTML itself is a problem; it's that the app I need to write would
do some rather heavy duty processing which I am more experienced with writing in
C based languages.
....Chambers
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Chambers wrote:
> Actually, I just need an app to be run by the server, at the request of certain
> web pages. The output could then be retrieved by other web pages.
So you're going to need to spawn a new process to handle things anyway, or
your web browser will time out. Hence, you can use any language you want to
do the computations, and use PHP to spawn it trivially.
> It's not that HTML itself is a problem; it's that the app I need to write would
> do some rather heavy duty processing which I am more experienced with writing in
> C based languages.
OK. If your "heavy duty processing" takes more than a minute or so, you need
to write a CGI page that will start it, and another that will let you know
if it's done and return the results, and you'll have to coordinate it.
--
Darren New, San Diego CA, USA (PST)
Human nature dictates that toothpaste tubes spend
much longer being almost empty than almost full.
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |