I want a Perl CGI script that will run a Ruby CGI script. The admins of
the webserver I’m trying to use tell me I can’t use Ruby but I can use
Perl. I don’t really know much Perl. Is there a Perl script that will
just pass the parameters to a Ruby CGI script and then print the output
as if it were its own? That would be kinda useful. :o)
-Kurt
#!/usr/local/bin/perl
exec(“ruby”,“otherprog.rb”)
But this is a pointless exercise… if you have the Ruby interpreter
installed then you might as well just make it a Ruby script in the first
place. It will save the cost of starting up a useless Perl interpreter for
every request. And if this is a policy issue (“Ruby is installed but you
are not allowed to use it for CGIs”) then the above code flouts the policy
just as badly.
Regards,
Brian.
···
On Wed, Aug 27, 2003 at 06:12:02AM +0900, Kurt M. Dresner wrote:
I want a Perl CGI script that will run a Ruby CGI script. The admins of
the webserver I’m trying to use tell me I can’t use Ruby but I can use
Perl. I don’t really know much Perl. Is there a Perl script that will
just pass the parameters to a Ruby CGI script and then print the output
as if it were its own? That would be kinda useful. :o)
Kurt M. Dresner graced us by uttering:
I want a Perl CGI script that will run a Ruby CGI script. The
admins of the webserver I’m trying to use tell me I can’t use
Ruby but I can use Perl.
You’d have to elaborate on this a bit more. For one, why
can’t you use it? Because they say so? Because it’s not present
on the server? Because it’s not approved for CGI use on the web
server? Because there isn’t enough industry pressure for them to
bother allowing/enabling Ruby CGI scripts? Or because they
didn’t know what you were talking about?
(To find out, ask to talk to THE Admin. There is always ONE (1)
Administrator; he’s the guy everyone points to when there’s a
problem. He’s also often the only one who really knows what’s
going on and all the factors involved. Ask to talk to “The
System Administrator.” That’s my best advice.)
If it’s only because they say so, well, don’t get me started.
I don’t really know much Perl. Is there a Perl script that
will just pass the parameters to a Ruby CGI script and then
print the output as if it were its own? That would be kinda
useful. :o)
If you can’t convince them to let you use Ruby CGI directly, and
you can’t switch hosts, my advice is (at the risk of being
flamed) the dreaded: Learn Perl. No, Perl doesn’t scale as well,
and lacks some of the niceties of Ruby, but if it needs to be
that scalable, it shouldn’t be CGI.
HTH,
Tim Hammerquist
···
–
ANIME LAW OF DEMONIC CONSISTENCY
Demons and other supernatural creatures have at least three eyes,
loads of fangs, tend to be yellow-green or brown, but black is not
unknown, and can only be hurt bladed weapons.
Kurt M. Dresner wrote:
I want a Perl CGI script that will run a Ruby CGI script. The admins of
the webserver I’m trying to use tell me I can’t use Ruby but I can use
Perl. I don’t really know much Perl.
Now, doesn’t that sound familiar! I’ve had the very same problem just a
week ago. The company I work for runs a virtual community (“game”). I’m
not a coder or technical personnel, but handle community work, policy
issues, customer service and the like. I do have access to the (Linux)
server machine that hosts various databases, log files and such, since I
need those in the course of my job. So after learning Ruby for some
time, I wanted to automate some processes with the help of Ruby scripts.
The boss said “Sure!”, the sysadmin said “No.”. I didn’t want this to
turn into a power struggle with my co-worker, so I tried to reason. His
point was that he wants all scripts to be written in either bash or
Perl, so that scripts can be maintained by multiple individuals, not
only the one who wrote the script. He seriously expected me to learn
Perl (I’d be okay with sh, but it’s not powerful enough for some of the
tasks I had in mind), to which I responded that he might as well learn
Ruby. Bad start, I agree! We talked for at least two hours and
eventually compromised: He agreed to install Ruby, and in return I
agreed to keep my Ruby scripts in my home directory so that others won’t
be tempted to use them. He also offered to eventually convert them to
Perl. It’s a compromise, nothing more, nothing less.
This kind of situation is really the downside of Ruby’s lack of
wide-spread popularity. If you are a paying customer of the company that
hosts your site, you might be able to coax them into installing Ruby by
telling them that you will have to take your business elsewhere if they
can’t do something as simple as offering an additional scripting
language. It’s unlikely to have an immediate impact, but maybe it’ll
make them realise that “Hey, there’s money on the table, we should grab
it!”.
M.
Brian Candler wrote:
#!/usr/local/bin/perl
exec(“ruby”,“otherprog.rb”)
And if this is a policy issue (“Ruby is installed but you
are not allowed to use it for CGIs”) then the above code flouts the policy
just as badly.
Well, technically, the Ruby script is not doing any CGI stuff, no?
The Perl script intermediates between the web server and the Ruby code.
James
···
Regards,
Brian.
I found out the problem.
The only Ruby install we have is for Linux. The webserver is a solaris
machine. Thus, my post about being unable to compile Ruby under
Solaris…
sigh
-Kurt
···
On Wed, Aug 27, 2003 at 10:49:39AM +0900, Tim Hammerquist wrote:
Kurt M. Dresner graced us by uttering:
I want a Perl CGI script that will run a Ruby CGI script. The
admins of the webserver I’m trying to use tell me I can’t use
Ruby but I can use Perl.
You’d have to elaborate on this a bit more. For one, why
can’t you use it? Because they say so? Because it’s not present
on the server? Because it’s not approved for CGI use on the web
server? Because there isn’t enough industry pressure for them to
bother allowing/enabling Ruby CGI scripts? Or because they
didn’t know what you were talking about?
(To find out, ask to talk to THE Admin. There is always ONE (1)
Administrator; he’s the guy everyone points to when there’s a
problem. He’s also often the only one who really knows what’s
going on and all the factors involved. Ask to talk to “The
System Administrator.” That’s my best advice.)
If it’s only because they say so, well, don’t get me started.
I don’t really know much Perl. Is there a Perl script that
will just pass the parameters to a Ruby CGI script and then
print the output as if it were its own? That would be kinda
useful. :o)
If you can’t convince them to let you use Ruby CGI directly, and
you can’t switch hosts, my advice is (at the risk of being
flamed) the dreaded: Learn Perl. No, Perl doesn’t scale as well,
and lacks some of the niceties of Ruby, but if it needs to be
that scalable, it shouldn’t be CGI.
HTH,
Tim Hammerquist
ANIME LAW OF DEMONIC CONSISTENCY
Demons and other supernatural creatures have at least three eyes,
loads of fangs, tend to be yellow-green or brown, but black is not
unknown, and can only be hurt bladed weapons.
======= End of Original Message =======<
Chances are, when he starts to convert them to Perl, he’ll become a convert
to Ruby …
-austin
···
On Thu, 28 Aug 2003 23:14:49 +0900, Michael Vondung wrote:
Kurt M. Dresner wrote:
I want a Perl CGI script that will run a Ruby CGI script. The admins
of the webserver I’m trying to use tell me I can’t use Ruby but I can
use Perl. I don’t really know much Perl.
Now, doesn’t that sound familiar! I’ve had the very same problem just a
week ago. The company I work for runs a virtual community (“game”). I’m
not a coder or technical personnel, but handle community work, policy
issues, customer service and the like. I do have access to the (Linux)
server machine that hosts various databases, log files and such, since I
need those in the course of my job. So after learning Ruby for some time,
I wanted to automate some processes with the help of Ruby scripts. The
boss said “Sure!”, the sysadmin said “No.”. I didn’t want this to turn
into a power struggle with my co-worker, so I tried to reason. His point
was that he wants all scripts to be written in either bash or Perl, so
that scripts can be maintained by multiple individuals, not only the one
who wrote the script. He seriously expected me to learn Perl (I’d be okay
with sh, but it’s not powerful enough for some of the tasks I had in
mind), to which I responded that he might as well learn Ruby. Bad start,
I agree! We talked for at least two hours and eventually compromised:
He agreed to install Ruby, and in return I agreed to keep my Ruby scripts
in my home directory so that others won’t be tempted to use them. He also
offered to eventually convert them to Perl. It’s a compromise, nothing
more, nothing less.
–
austin ziegler * austin@halostatue.ca * Toronto, ON, Canada
software designer * pragmatic programmer * 2003.08.28
* 11.23.33
Chances are, when he starts to convert them to Perl, he’ll become a convert
to Ruby …
Sooo true. I was just sitting here thinking “Um, that’s going to suck,
especially if you’ve taken advantage of Ruby’s OOP.”
-Kurt
···
-austin
austin ziegler * austin@halostatue.ca * Toronto, ON, Canada
software designer * pragmatic programmer * 2003.08.28
* 11.23.33
======= End of Original Message =======<