Re: Php perl?

2003-04-06 Thread Scott R. Godin
George Schlossnagle wrote:

> 
> On Friday, April 4, 2003, at 01:56  PM, Scott R. Godin wrote:
>> The question I have is with the current Apache (2.x)
> 
> First off, Apache 2.x is highly beta software.  Almost no-one is
> running it in production.  The questionable thread-safety of many third
> party libraries makes anything but the pre-fork MPM largely unusable
> for most people (php and perl).

Right. The place that I mention below was using 1.3.x .. Whether or not 
Apache 2.x is still not widely regarded as stable, this does not invalidate 
the question. 

>> and mod_perl (1.27?)
>> involved, when a perl program is incorporated into the httpd process in
>> this manner, how much more *memory* overhead does each httpd process
>> require over related circumstances in php?
> 
> Probably more relevant to that is to look at so-called realistic
> performance benchmarks.  When the Yahoo! folks were deciding to swicth
> from their hown-grown scripting language to something more mainstream,
> they did an internal performance bakeoff between a mod_perl solution
> and a mod_php solution.  Properly tuned they delivered almost identical
> performance numbers.  Look up Michael Radwin's 'Making The Case for PHP
> at Yahoo!' talk from PHPCON 2002 for the details.  (It was an
> interesting talk no matter outside of this as well.  An interesting
> take on the differences between language solutions.)

performance speed wise and performance in terms of how much extra memory 
each httpd child requires are different animals. I'll look up the article 
though. should be interesting reading. 

>> for example if I use CGI.pm to create a form (using its functional
>> interface to produce the actual HTML seen) and also respond to said 
>> form, how much more RAM will each httpd process require if this is 
>> run under mod_perl?
> 
> Comparing mod_php to CGI.pm is really apples and oranges.  CGI.pm pages
> result in a high level of intermingling between Perl code and html
> code.The resultant soup looks neither like HTML or Perl.  PHP on

I don't know how you code personally, or what sort of code you encounter, 
but when I code CGI.pm applications the processing sections look like perl 
and the output sections look like html (very much so thanks to CGI.pm's 
function-oriented interface. This also has the VERY nice side-effect that 
all the html closures are provided for and wrapped properly... i.e. it's 
easier to produce well-formed html via this method.) To *me*, the 
intermingling of html and php looks more like soup. 

> the other hand is designed for embedding of code fragments within HTML,
> producing code that still largely looks like HTML.  This allows (but
> doesn't force you) to have as much separation of display logic from
> application logic as you would like.  This isn't PHP FUD, there are
> solutions in almost every language that emulate this behavior:
> 
> Perl: Apache::ASP, embperl (both mod_perl)
> Python: mod_python, mod_snake, mod_psp
> VB: ASP
> PHP: PHP
> ?: ?

true true.

> They've chosen this model because for a huge number of people it's the
> Right Way (tm) to solve the web problem.
> 
>>
>> One argument I've been handed by the php camp is that in a mod_perl
>> situation, this will cause apache processes to become much larger,
>> thereby taking up more of the precious memory resources.
> 
> In my experience that statement is pretty vacuous.  The PHP and
> mod_perl footprints both largely depend on the size of the source code
> base you are running and the number of extensions/packages you use.
> It's hard to get a side-by-side comparison.  And why bother.
> Performance numbers and code maintainability/extensibility are what
> really matter.

Also true. Considering an un-mod_perl cgi accessing a database via DBI will 
run considerably slower than one that is run under mod_perl, and also 
considerably slower than its php counterpart. 

This is one of the things I ran into where the people involved outright 
refused to even consider testing with mod_perl and instead waved specious 
benchmarks around comparing the perl vs the php in completely unrelated 
contexts. It was quite frustrating to nice well-formed scripts thrown out 
because of the lack of support hooks in the httpd process that the 
'opposing' scripts were given. 

>> (consider a large gaming website like planetunreal (which IIRC uses
>> .asp),
>> or quakeworld, which garner huge volumes of hits on a daily basis)
> 
> I've run PHP on a website doing 130 million page requests/day.  I've
> also run Apache::ASP on a site doing 10 million hits per day.  They
> both run fine.  Performance wise, the language-intrinsic differences
> are small in comparison to user code performance issues (sub optimal
> database queries, suboptimal code implementation, poor architectural
> choices, etc.).

I totally agree with this, which is why the situation was so frustrating. 

>> This issue needs to be addressed firmly to the php camp, because the
>> FUD being sprea

Re: Php perl?

2003-04-05 Thread George Schlossnagle
On Saturday, April 5, 2003, at 04:07  PM, R. Joseph Newton wrote:

George Schlossnagle wrote:

... Answering FUD
FUD = ?
Fear, Uncertainty and Doubt.  Basically unsubstantiated comments used 
to discredit a (competing) product.

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Php perl?

2003-04-05 Thread R. Joseph Newton
George Schlossnagle wrote:

> ... Answering FUD

FUD = ?

Joseph


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Php perl?

2003-04-05 Thread R. Joseph Newton
Elias Assmann wrote:

> On Tue, Apr 01, 2003 at 10:42:57PM -0800, R. Joseph Newton wrote:
>
> > Neither language is strongly typed, as C, Java, or VB are.  Although
> > both are type-sensitive, they still restrict identifiers only by
> > contaiment class.
>
> Could you elaborate on that? What do you mean by "type-sensitive"

They both respond to implicit cues as to data type:
my $var1 = "Hi";
my $var2 = "2";
print $var1 + 1 . "\n";
print $var1 + 1 . "\n";
Print $var1 . ", there.\n";
print $var2 . ", there \n";

in each case above, the language first recognizes that the var is
receiving a string.  The it converts the string as called for to any
numerical value it may express.  We know that it does not handle numerical
operations in the same way as string operations.


> and
> "restrict identifiers ..."?

In genral-purpose use we declare Perl variables as one of three
containment classes:
$  scalar
@  array
%  hash

Perl strictly enforces the difference, although it does allow for
conversions through assignment.
#!perl -w

#!perl -w

use strict;

my $my_var = 2;
my @my_var = (9, 2, 3);
my %my_var = ('4', 5, '3', 6);

print "$my_var\n";
print "\n";

foreach (@my_var) {
 print "$_\n";
}
print "\n";

foreach (keys %my_var) {
  print "$_: $my_var{$_}\n";
}
print "\n";


 YIELDS:

Howdy, podner! E:\d_drive\perlStuff>containment.pl
2

9
2
3

4: 5
3: 6

Call it what one will each my_var knows which containment class it was
declared in.  erl will not allow operations that are not appropriate for
the type of containment class being addressed.  Although Perl will issue a
warning for implicit casts between numeric and string, it will still allow
them:

my $var3 = "cat";
my $var4 = "dog";
if ($var4 > $var3) {
  print "dogs are greater than cats\n";
} else {
  print "Mroor\n";
}

When the above code is run without warnings, the output is simply:
Mroor

OTOH, if you do this
my @my_var2 = (9, 2, 3);
...
$my_var2{'my_key'} = "Beat the system";

without warnings turned on, but using strict:
Global symbol "%my_var2" requires explicit package name at
E:\d_drive\perlStuff\
containment.pl line 17.
Execution of E:\d_drive\perlStuff\containment.pl aborted due to
compilation erro
rs.

Without strict, of course, Perl will let you go ahead and create the new
hash %my_var implicitly.

H, you know, the more I play with this, the less I see any quantum
difference between Perl's handling of differences between primitive data
types and its handling of differences between containment types.  With
either situation, if it sees a sensible conversion to make, it will make
it.

Joseph


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Php perl?

2003-04-05 Thread Scott R. Godin
Gary Stainburn wrote:

> Just to put things into perspective here
> 
> 1) I made the comment about the start-up speed.
> 2) Although I use PHP frequently my feet are FIRMLY in the Perl camp
> 3) Unix Fork/Load/Exec cycle *IS* slow because of the amount of work
> involved. The MS equiv will be just as slow
> 4) The F/L/E cycle has to be done *every* time the CGI is requested.
> 
> The PHP interpreter is already loaded and therefore *WILL* have a quicker
> startup. I don't have figures to back it up, but I would imagine Perl
> scripts exec much quicker that PHP asuming both scripts perform the same
> function.
> 
> (From memory) Using mod_perl will only require scripts to be loaded and
> compiled once per lifetime of the apache daemon so will be much quicker
> overall and provide less load on the server than either traditional CGI's.

The question I have is with the current Apache (2.x) and mod_perl (1.27?) 
involved, when a perl program is incorporated into the httpd process in 
this manner, how much more *memory* overhead does each httpd process 
require over related circumstances in php? 

for example if I use CGI.pm to create a form (using its functional interface 
to produce the actual HTML seen) and also respond to said form, how much 
more RAM will each httpd process require if this is run under mod_perl ? 

One argument I've been handed by the php camp is that in a mod_perl 
situation, this will cause apache processes to become much larger, thereby 
taking up more of the precious memory resources. 

(consider a large gaming website like planetunreal (which IIRC uses .asp), 
or quakeworld, which garner huge volumes of hits on a daily basis)

This issue needs to be addressed firmly to the php camp, because the FUD 
being spread was enough to cost me one of the most fun hobby projects I was 
involved with, and the one that got me started on the perl path to begin 
with while they were still on .asp and had not yet migrated the site to a 
linux server and mod_php...  

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Php perl?

2003-04-04 Thread Gary Stainburn
On Friday 04 Apr 2003 3:59 pm, Dan Muey wrote:
> > Dan Muey <[EMAIL PROTECTED]> wrote:
> > > If you want it to run like mod_php use mod_perl. Someone said that
> > > not using mod_perl "increases dramatically the startup".
> >
> > Yeah by like
> >
> > > zillionth of a second.
> >
> > Hi Dan,
> >
> > And remember that the "startup" can also include loading modules,
> > connecting to an RDMS, parsing XSL stylesheets, etc...
>
> Right but what I meant was "all things else being the same" .
> IE a perl script that connects to a database and adds 100,000 records
> will be slower than php script that print "Hello, World" and vice versa.
>
> So what I meant was take a script of each that does the exact same thing.
> The non mod_perl perl script will not have "dramatically increased
> startup". It may have, I believe I said, a zillionth of a second
> difference.
>
> The point was that mod_php isn't a zillion times faster than a non mod_perl
> script.
>
> That's what bugs the crap out of me about PHP people. They're so dramatic
> about how wonderful PHP is when it does the same stuff, and usually less,
> than lots of other scripting languages, not just perl.

Just to put things into perspective here

1) I made the comment about the start-up speed.
2) Although I use PHP frequently my feet are FIRMLY in the Perl camp
3) Unix Fork/Load/Exec cycle *IS* slow because of the amount of work involved. 
The MS equiv will be just as slow
4) The F/L/E cycle has to be done *every* time the CGI is requested.

The PHP interpreter is already loaded and therefore *WILL* have a quicker 
startup. I don't have figures to back it up, but I would imagine Perl scripts 
exec much quicker that PHP asuming both scripts perform the same function.

(From memory) Using mod_perl will only require scripts to be loaded and 
compiled once per lifetime of the apache daemon so will be much quicker 
overall and provide less load on the server than either traditional CGI's.

-- 
Gary Stainburn
 
This email does not contain private or confidential material as it
may be snooped on by interested government parties for unknown
and undisclosed purposes - Regulation of Investigatory Powers Act, 2000 


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Php perl?

2003-04-04 Thread Dan Muey

> Dan Muey <[EMAIL PROTECTED]> wrote:
> > 
> > If you want it to run like mod_php use mod_perl. Someone said that
> > not using mod_perl "increases dramatically the startup". 
> Yeah by like 
> > zillionth of a second.
> 
> Hi Dan,
> 
> And remember that the "startup" can also include loading modules, connecting to an 
> RDMS, parsing XSL stylesheets, etc...

Right but what I meant was "all things else being the same" .
IE a perl script that connects to a database and adds 100,000 records 
will be slower than php script that print "Hello, World" and vice versa.

So what I meant was take a script of each that does the exact same thing.
The non mod_perl perl script will not have "dramatically increased startup".
It may have, I believe I said, a zillionth of a second difference. 

The point was that mod_php isn't a zillion times faster than a non mod_perl script.

That's what bugs the crap out of me about PHP people. They're so dramatic about how 
wonderful PHP is when it does the same stuff, and usually less, than lots of other
scripting languages, not just perl.


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Php perl?

2003-04-03 Thread George Schlossnagle
On Thursday, April 3, 2003, at 11:04  AM, Bob Showalter wrote:
But can you write a "stand-alone" script using PHP and run it from a 
shell
prompt, for example?
Yes.

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: Php perl?

2003-04-03 Thread Bob Showalter
R. Joseph Newton wrote:
> Bob Showalter wrote:
> 
> > [EMAIL PROTECTED] wrote:
> > > I have a PHP vs. Perl question for a hobby project of mine. Which
> > > would be the better language to use if I wanted to go out to a
> > > particular web page and parse the table that's there? How about if
> > > each row in the HTML table contains a link to another Web page
> > > which has information I want to grab? (BTW, the page I'm thinking
> > > of is the Catalog of Extrasolar Planets by Jean Schneider, at
> > > http://www.obspm.fr/encycl/catalog.html.)
> > > 
> > > FYI, I've never done any Web programming.
> > 
> > AFAIK, PHP is a server-side language. What you're describing is a
> > client application. I don't think you can write general-purpose
> > client applications using PHP (PHP guys correct me if I'm wrong!).
> > I'm sure PHP can do HTTP client stuff, but I think you still need
> > to be operating in the server environment. 
> > 
> > Perl has the LWP family of modules for doing HTTP client
> > applications, as well as various HTML and XML parsing modules that
> > can be used for what you're describing.
> 
> PHP does describe itself as a genral-purpose language.  We
> know, though, that Perl has LWP::UserAgent, which sound
> pretty well-suited for scott's task.  He would probably have
> to ask on a PHP list to really get a wide range of eedback on
> client modules available for PHP
> 
> My guess is that there is sometime similar, and the decision
> would come down to a matter of taste.

But can you write a "stand-alone" script using PHP and run it from a shell
prompt, for example? Or can it only run in the context of a web server
servicing an HTTP request? I'm asking out of ignorance.

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Php perl?

2003-04-03 Thread Steve Grazzini
Dan Muey <[EMAIL PROTECTED]> wrote:
> 
> If you want it to run like mod_php use mod_perl. Someone said that 
> not using mod_perl "increases dramatically the startup". Yeah by like 
> zillionth of a second.

Hi Dan,

There are a number of benchmarks at 

  

And some performance-related stuff at

   

And remember that the "startup" can also include loading modules,
connecting to an RDMS, parsing XSL stylesheets, etc...

-- 
Steve

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Php perl?

2003-04-02 Thread R. Joseph Newton
Bob Showalter wrote:

> [EMAIL PROTECTED] wrote:
> > I have a PHP vs. Perl question for a hobby project of mine. Which
> > would be the better language to use if I wanted to go out to a
> > particular web page and parse the table that's there?  How about if
> > each row in the HTML table contains a link to another Web page which
> > has information I want to grab? (BTW, the page I'm thinking of is the
> > Catalog of Extrasolar Planets by Jean Schneider, at
> > http://www.obspm.fr/encycl/catalog.html.)
> >
> > FYI, I've never done any Web programming.
>
> AFAIK, PHP is a server-side language. What you're describing is a client
> application. I don't think you can write general-purpose client applications
> using PHP (PHP guys correct me if I'm wrong!). I'm sure PHP can do HTTP
> client stuff, but I think you still need to be operating in the server
> environment.
>
> Perl has the LWP family of modules for doing HTTP client applications, as
> well as various HTML and XML parsing modules that can be used for what
> you're describing.

PHP does describe itself as a genral-purpose language.  We know, though, that Perl has 
LWP::UserAgent, which sound pretty well-suited for scott's task.  He would probably 
have to ask on a PHP list to really get a wide range of eedback on client modules 
available for PHP

My guess is that there is sometime similar, and the decision would come down to a 
matter of taste.

Joseph


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [mail_lists] RE: Php perl?

2003-04-02 Thread George Schlossnagle
On Wednesday, April 2, 2003, at 01:19  PM, Jim wrote:
| Perl has the LWP family of modules for doing HTTP client 
applications, as
| well as various HTML and XML parsing modules that can be used for 
what
| you're describing.
PHPs support for this is actually really nice.  For simple things you 
can just do:

$fp = fopen("http://www.omniti.com/";);

and treat it like a normal file handle (or resource in php-talk).  The 
curl extension is quite nice as well - provides the same granularity of 
LWP using libcurl (which is a truly magnificent library).

George

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: [mail_lists] RE: Php perl?

2003-04-02 Thread Jim
On Wednesday 02 April 2003 08:10, Bob Showalter wrote:
| [EMAIL PROTECTED] wrote:
| > I have a PHP vs. Perl question for a hobby project of mine. Which
| > would be the better language to use if I wanted to go out to a
| > particular web page and parse the table that's there?  How about if
| > each row in the HTML table contains a link to another Web page which
| > has information I want to grab? (BTW, the page I'm thinking of is the
| > Catalog of Extrasolar Planets by Jean Schneider, at
| > http://www.obspm.fr/encycl/catalog.html.)
| >
| > FYI, I've never done any Web programming.
|
| AFAIK, PHP is a server-side language. What you're describing is a client
| application. I don't think you can write general-purpose client
| applications using PHP (PHP guys correct me if I'm wrong!). I'm sure PHP
| can do HTTP client stuff, but I think you still need to be operating in the
| server environment.
|

Nope.  Actually, PHP can do both now.  Before it was somewhat difficult to 
do...and even now it is a bit kludgy but it is absolutely possible.  I am 
currently involved in a project that uses PHP for both web and non-web (CLI) 
related activitiy.

I do have to admit that PHP's build is ridiculously difficult compared to 
Perl.

| Perl has the LWP family of modules for doing HTTP client applications, as
| well as various HTML and XML parsing modules that can be used for what
| you're describing.

-- 

- Jim

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Php Perl?

2003-04-02 Thread Jim

On Tuesday 01 April 2003 11:23, Adriano Allora wrote:

This has been an interesting thread.  Here's my take:

I like them both but I prefer Perl.  I use to say that Perl was best for 
application level stuff and PHP was best for web content related stuff.  
However, that kind of thinking is somewhat deprecated now since PHP has done 
some evolving.

I have a friend who is into PHP very much.  Indeed, he is one of those that 
*hates* Perl and *loves* PHP.  Frankly, I don't think he put the time into 
Perl to really appreciate it.  OTH, I find that some people just can't stand 
the way Perl has magic variables, handles regular expressions, and has 
implicit handling of certain things.  I LOVE that about Perl.  It makes 
coding faster imo.

There is only one thing I like better about PHP than Perl.  PHP's OOP seems 
to be more like OOP.  However, for me...I don't do OOP =P  So, on the 
personal level that doesn't mean much to me.

PHP can be used, now, for application level stuff.  This is one of the ways 
PHP has evolved.  But one of the things I do not like about PHP is it's use 
of function calls for everything.  Now, I admit, this is ridiculous because 
ever other language, other than Perl, uses functions for *everything*.  This 
is where Perl has spoiled me.  What am I talking about?

A regular expression in PHP looks like:
preg_match("/<(\w+)(.*?)>(.+)<\/\\1>/s", $data, $regs);

Perl:
/<(\w+)(.*?)>(.+)<\/\\1>/;  # implicit functionality

This is the thing my friend hates and the thing I love.  He blames it on his 
being use to C.  I can understand that.  I have never really seen huge 
resource hits using PHP vs Perl.  I can't say which one uses more resources.  
I suppose it would be a neat test for someone to write a script that does the 
same thing in PHP and Perl and to benchmark it.  Does PHP have a benchmarking 
module yet?

Oh wellto each his own.  I neither hate or love PHP.  I feel it does have 
a place out there in the cyberworld.  It has some good qualities about it.  I 
just love Perl.  I *need* to learn more C.  I have to say that I really like 
the windows PHP documentation (*.chm file).  When I was using Windows that 
was a HUGE plus to PHP.  Is there a such thing for Perl?  I've never seen it.

PHP and Perl kick any microsoft language's butt when it comes to quality, 
security, and ability.

- Jim


| Hi,
| I used to use ASP, then I start to use PHP and now I'm learning perl.
| Perl is more efficent and powerful but also (a bit?) more difficult
| than PHP.
| PHP is a very... comfortable scripting language to develop web-pages
| (similar to ASP, but more easy), and stop there.
| Perl is perfect to do a lot of other activities (I use it to process
| text files).
| They rarely works together.
| If you can, learn both of them!
|
|
| all'adr
|
| Martedì, 1 Apr 2003, alle 03:12 Europe/Rome, Paul Kraus ha scritto:
| > Is perl used to compliment PHP or is perl better to use by itself
| > instead of php? How does one relate to the other. I am coming from a
| > asp.NET vp.NET .asp vb background and am trying to get away form M$. So
| > I am looking at apache php and perl trying to figure out how all the
| > pieces fit together.
| >
| > To show you my ignorance I thought php and apache where the same thing
| >
| > :)
| >
| > Paul
| >
| >
| > --
| > To unsubscribe, e-mail: [EMAIL PROTECTED]
| > For additional commands, e-mail: [EMAIL PROTECTED]

-- 

- Jim

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Php perl?

2003-04-02 Thread Bob Showalter
[EMAIL PROTECTED] wrote:
> I have a PHP vs. Perl question for a hobby project of mine. Which
> would be the better language to use if I wanted to go out to a
> particular web page and parse the table that's there?  How about if
> each row in the HTML table contains a link to another Web page which
> has information I want to grab? (BTW, the page I'm thinking of is the
> Catalog of Extrasolar Planets by Jean Schneider, at
> http://www.obspm.fr/encycl/catalog.html.) 
> 
> FYI, I've never done any Web programming.

AFAIK, PHP is a server-side language. What you're describing is a client
application. I don't think you can write general-purpose client applications
using PHP (PHP guys correct me if I'm wrong!). I'm sure PHP can do HTTP
client stuff, but I think you still need to be operating in the server
environment.

Perl has the LWP family of modules for doing HTTP client applications, as
well as various HTML and XML parsing modules that can be used for what
you're describing. 


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Php perl?

2003-04-02 Thread Dan Muey

> On Wednesday, April 2, 2003, at 10:31  AM, Dan Muey wrote:
> 
> >
> > Like I said, a very informative happy thread!
> > Peace to everyone!! I love all people, I just use Perl.

I should say I use PHP as well so I'm not total PHP virgin!
I use phpbb for some customers and it is quite sexxy!

I just do a lot of, email parsing and high end web based database 
front and back ends and prefer perl for those tasks although I know 
PHP handles MySql quite well.

Ok I'll shut up now since evryone's probably tired of my rantings!

> 
> Indeed.  As I noted in my disclaimer, I use Perl as well (quite 
> happily).  They are both good languages, and they both have 
> the toolset 
> to tackle most problems.  'Should I use X or Y' should either be a 
> personal comfort decision (based on the language you know or want to 
> know), or an institutional decision (based on your programming 
> resources, legacy code, political motivations, star signs, or 
> what have 
> you.)
> 
> Of course this is a Perl list, so in many ways you (the original 
> author) are in effect asking 'is Perl and appropriate tool 
> for X'.  And 
> the answer seems to be yes (I hope so - my business is based 
> on it.  :)
> 
> >
> > I'm not really sure about the 'greater foothold' thing.
> > Since yahoo is using it we'll never hear the end of that
> > one!
> 
> The netcraft results are pretty telling. This is just for web 
> of course 
> (and I don't think anyone would argue with Perl being a 
> leading if not 
> the leading systems scripting language, with PHP being 
> nowhere on that 
> map currently).
> 
> >
> > I'd agree with George :
> > - they benchmark similar
> > - depends on what you're comfortable with
> > 
> > Thanks for your input George, I apologize if I came across badly to
> > you!
> 
> Not at all!  Just pointing out that there is spin placed by users of 
> both.  I would agree that PHP users have a higher zealot factor in 
> general.
> 
> George
> 
> 

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Php perl?

2003-04-02 Thread George Schlossnagle
On Wednesday, April 2, 2003, at 10:31  AM, Dan Muey wrote:

Like I said, a very informative happy thread!
Peace to everyone!! I love all people, I just use Perl.
Indeed.  As I noted in my disclaimer, I use Perl as well (quite 
happily).  They are both good languages, and they both have the toolset 
to tackle most problems.  'Should I use X or Y' should either be a 
personal comfort decision (based on the language you know or want to 
know), or an institutional decision (based on your programming 
resources, legacy code, political motivations, star signs, or what have 
you.)

Of course this is a Perl list, so in many ways you (the original 
author) are in effect asking 'is Perl and appropriate tool for X'.  And 
the answer seems to be yes (I hope so - my business is based on it.  :)

I'm not really sure about the 'greater foothold' thing.
Since yahoo is using it we'll never hear the end of that
one!
The netcraft results are pretty telling. This is just for web of course 
(and I don't think anyone would argue with Perl being a leading if not 
the leading systems scripting language, with PHP being nowhere on that 
map currently).

I'd agree with George :
	- they benchmark similar
	- depends on what you're comfortable with
	
Thanks for your input George, I apologize if I came across badly to 
you!
Not at all!  Just pointing out that there is spin placed by users of 
both.  I would agree that PHP users have a higher zealot factor in 
general.

George

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: Php perl?

2003-04-02 Thread Dan Muey
> I have a PHP vs. Perl question for a hobby project of mine.  

Hobby not homework right? :)

> Which would be the better language to use if I wanted to go 
> out to a particular web page and parse the table that's 

Don't know how you'd do it with PHP but with perl you could use LWP and HTML::Parser.

Go to search.cpan.org and have a look.

You may also want to look at the CGI module which is very helpful for web programming.

> there?  How about if each row in the HTML table contains a 
> link to another Web page which has information I want to 
> grab? (BTW, the page I'm thinking of is the Catalog of 
> Extrasolar Planets by Jean Schneider, at 
> http://www.obspm.fr/encycl/catalog.html.)

Cool page!!

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Php perl?

2003-04-02 Thread Dan Muey

Like I said, a very informative happy thread!
Peace to everyone!! I love all people, I just use Perl. 

I'm not really sure about the 'greater foothold' thing. 
Since yahoo is using it we'll never hear the end of that
one!

I'd agree with George :
- they benchmark similar
- depends on what you're comfortable with

Thanks for your input George, I apologize if I came across badly to you!

Peace to all!

DMuey

> On Wednesday, April 2, 2003, at 09:52  AM, Dan Muey wrote:
> 
> > This is a cool thread. I'm glad everyone is staying so 
> peaceful about 
> > It. That's another thing I don't like about PHP is that if I was 
> > having this discussion with a PHP person thet'd be insulting me for 
> > even considering something else.
> 
> I think that sort of zealousness exists in many languages - Perl 
> included.  PHP has a much larger foothold in the web market 
> than Perl, 
> and has a shallower learning curve, so it has a large 
> 'unwashed masses' 
> factor at the bottom.
> 
> BTW, I am a 'PHP person' (I'm a core developer on the PHP 
> project), and 
> I run a company that does almost exclusively Perl programming for the 
> web, using Apache:::ASP.  So that's my spin and where I'm coming from.
> 
> > If your wondering about reliability and stability and 
> fuunctionality 
> > ::
> >
> > Perl has been around a long time.
> 
> Yes.  And Perl in general is much more mature.  However if you are 
> looking at HTML-embedding solutions (embperl, Apache::ASP, 
> etc.), they 
> are much less mature than Perl as a whole and thus Pelr in 
> that domain 
> is still a bit krufty.
> 
> > Perl powers a huge part of the internet, networks, etc...
> 
> PHP has a much larger marketshare for web scripting though.
> 
> >
> > I even use it on my home computer to keep track of scheduling, data,
> > email etc..
> >
> > Perl has greater functionality than PHP.
> 
> I would personally agree with this, but this statement has high FUD 
> value.  It's about comfort level.  There are many things that are 
> easier to do in PHP than in Perl, and vice-versa.  There aren't too 
> many things I have needed to do that just couldnt be done in 
> either of 
> the languages.
> 
> >
> > If you want it to run like mod_php use mod_perl. Someone 
> said that not 
> > using mod_perl "increases dramatically the startup". Yeah by like 
> > zillionth of a second.
> 
> I agree this is bogus.  You serve multiple requests per child, so the 
> startup cost is amortized out.  I should note that mod_php != 
> mod_perl. 
>   They have distinct, non-overlapping feature sets.  PHP is 
> by original 
> construction a templating language that allows embedding code 
> directly 
> in HTML pages.  mod_perl by itself is no such beast, but is 
> instead an 
> embedded interpreter in apache, exposing all the apache module hooks 
> via Perl (similar thing exists in PHP, but it's in beta).
> 
> To 'do what mod_php does', you need to run something on top of 
> mod_perl, like embperl or Apache::ASP.
> 
> >
> > In fact if I run a plain old non mod_perl cgi and the some 
> PHP thing,
> > both doing the same
> > Exact thing, say parsing a form and emailing it to one person, Then 
> > I'd bet that
> > They were one of two things :: very close to each other in 
> speed, or 
> > Perl would be faster.
> >
> > Now add the mod_perl and all is well.
> 
> PHP and mod_perl benchmark out about the same by all accounts 
>  (Michael 
> Radwin's slides re: choosing PHP for Yahoo! have some nice graphs).
> 
> >
> > Basically the realiability is the same on both. Does PHP do what you
> > need? Who knows. Does Perl?
> > You bet you sweet mother it does and a lot more than you 
> probably ever 
> > thought of.
> 
> More FUD.  PHP certainly can do what you want to do.  The question 
> (IMHO) is what language are you most comfortable with.  If you're 
> starting from scratch, PHP is really hard to beat as a 
> solution to the 
> web problem.  It's simple and intuitive and has a shallow learning 
> curve.  OTOH, if you already know Perl, and especially if you are 
> building on a legacy code-base, Perl is a fine solution as well.
> 
> George
> 
> 
> 
> 

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Php perl?

2003-04-02 Thread scott . e . robinson

I have a PHP vs. Perl question for a hobby project of mine.  Which would be
the better language to use if I wanted to go out to a particular web page
and parse the table that's there?  How about if each row in the HTML table
contains a link to another Web page which has information I want to grab?
(BTW, the page I'm thinking of is the Catalog of Extrasolar Planets by Jean
Schneider, at http://www.obspm.fr/encycl/catalog.html.)

FYI, I've never done any Web programming.

Thanks,

Scott

Scott E. Robinson
SWAT Team
UTC Onsite User Support
RR-690 -- 281-654-5169
EMB-2813N -- 713-656-3629


   
 
  George   
 
  Schlossnagle To:   "Dan Muey" <[EMAIL 
PROTECTED]>  
  <[EMAIL PROTECTED]   cc:   "R. Joseph Newton" <[EMAIL 
PROTECTED]>, <[EMAIL PROTECTED]>,
  >  <[EMAIL PROTECTED]>   
    
   Subject:  Re: Php perl? 
 
   
 
  04/02/03 09:18 AM
 
   
 
   
 




On Wednesday, April 2, 2003, at 09:52  AM, Dan Muey wrote:

> This is a cool thread. I'm glad everyone is staying so peaceful about
> It. That's another thing I don't like about PHP is that if I was having
> this discussion with a PHP person thet'd be insulting me for even
> considering
> something else.

I think that sort of zealousness exists in many languages - Perl
included.  PHP has a much larger foothold in the web market than Perl,
and has a shallower learning curve, so it has a large 'unwashed masses'
factor at the bottom.

BTW, I am a 'PHP person' (I'm a core developer on the PHP project), and
I run a company that does almost exclusively Perl programming for the
web, using Apache:::ASP.  So that's my spin and where I'm coming from.

> If your wondering about reliability and stability and fuunctionality ::
>
> Perl has been around a long time.

Yes.  And Perl in general is much more mature.  However if you are
looking at HTML-embedding solutions (embperl, Apache::ASP, etc.), they
are much less mature than Perl as a whole and thus Pelr in that domain
is still a bit krufty.

> Perl powers a huge part of the internet, networks, etc...

PHP has a much larger marketshare for web scripting though.

>
> I even use it on my home computer to keep track of scheduling, data,
> email etc..
>
> Perl has greater functionality than PHP.

I would personally agree with this, but this statement has high FUD
value.  It's about comfort level.  There are many things that are
easier to do in PHP than in Perl, and vice-versa.  There aren't too
many things I have needed to do that just couldnt be done in either of
the languages.

>
> If you want it to run like mod_php use mod_perl. Someone said that not
> using mod_perl "increases dramatically the startup". Yeah by like
> zillionth of a second.

I agree this is bogus.  You serve multiple requests per child, so the
startup cost is amortized out.  I should note that mod_php != mod_perl.
  They have distinct, non-overlapping feature sets.  PHP is by original
construction a templating language that allows embedding code directly
in HTML pages.  mod_perl by itself is no such beast, but is instead an
embedded interpreter in apache, exposing all the apache module hooks
via Perl (similar thing exists in PHP, but it's in beta).

To 'do what mod_php does', you need to run something on top of
mod_perl, like embperl or Apache::ASP.

>
> In fact if I run a plain old non mod_perl cgi and the some PHP thing,
> both doing the same
> Exact thing, say parsing a form and emailing it to one person, Then
> I'd bet that
> They were one of two things :: very close to each other in speed, or
> Perl would be faster.
>
> Now add the mod_perl and all is well.

PHP and mod_perl benchmark out about the same by all accounts  (Michael
Radwin's slides re: choosing PHP for Yahoo! have some nice graphs).

>
> Basically the realiabilit

RE: Php perl?

2003-04-02 Thread Dan Muey
One other thing for all you PHP fans (since it feels more like PHP) and you Perl folks 
too ::

There's a project called Moto.
http://www.projectmoto.org/

I ran into this when looking for a good mailing list archive.
It's pretty cool, it's an apache module, mod_moto and is very much like
PHP in appearance. There's one really cool thing though:

You can run it in two modes ::

Regular website style ::

index.moto
familyfun.moto
etc.moto
webapp.moto

Or, and here's the really cool part ::
Compile the entire site into one file and run it a zillion times faster !!
http://www.projectmoto.org/usecases.moto

This is a fairly new project, but it is very powerful at this young age.
I use it for a mailing list archive browser and it works quite smashingly!!

By the way here is a link to that mailing list archive in case any one is interested :
http://projects.standblue.net/software/markive/
 ( Thanks Cory!! )

DMuey

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Php perl?

2003-04-02 Thread George Schlossnagle
On Wednesday, April 2, 2003, at 09:52  AM, Dan Muey wrote:

This is a cool thread. I'm glad everyone is staying so peaceful about
It. That's another thing I don't like about PHP is that if I was having
this discussion with a PHP person thet'd be insulting me for even 
considering
something else.
I think that sort of zealousness exists in many languages - Perl 
included.  PHP has a much larger foothold in the web market than Perl, 
and has a shallower learning curve, so it has a large 'unwashed masses' 
factor at the bottom.

BTW, I am a 'PHP person' (I'm a core developer on the PHP project), and 
I run a company that does almost exclusively Perl programming for the 
web, using Apache:::ASP.  So that's my spin and where I'm coming from.

If your wondering about reliability and stability and fuunctionality ::

Perl has been around a long time.
Yes.  And Perl in general is much more mature.  However if you are 
looking at HTML-embedding solutions (embperl, Apache::ASP, etc.), they 
are much less mature than Perl as a whole and thus Pelr in that domain 
is still a bit krufty.

Perl powers a huge part of the internet, networks, etc...
PHP has a much larger marketshare for web scripting though.

I even use it on my home computer to keep track of scheduling, data, 
email etc..

Perl has greater functionality than PHP.
I would personally agree with this, but this statement has high FUD 
value.  It's about comfort level.  There are many things that are 
easier to do in PHP than in Perl, and vice-versa.  There aren't too 
many things I have needed to do that just couldnt be done in either of 
the languages.

If you want it to run like mod_php use mod_perl. Someone said that not
using mod_perl "increases dramatically the startup". Yeah by like 
zillionth of a second.
I agree this is bogus.  You serve multiple requests per child, so the 
startup cost is amortized out.  I should note that mod_php != mod_perl. 
 They have distinct, non-overlapping feature sets.  PHP is by original 
construction a templating language that allows embedding code directly 
in HTML pages.  mod_perl by itself is no such beast, but is instead an 
embedded interpreter in apache, exposing all the apache module hooks 
via Perl (similar thing exists in PHP, but it's in beta).

To 'do what mod_php does', you need to run something on top of 
mod_perl, like embperl or Apache::ASP.

In fact if I run a plain old non mod_perl cgi and the some PHP thing, 
both doing the same
Exact thing, say parsing a form and emailing it to one person, Then 
I'd bet that
They were one of two things :: very close to each other in speed, or 
Perl would be faster.

Now add the mod_perl and all is well.
PHP and mod_perl benchmark out about the same by all accounts  (Michael 
Radwin's slides re: choosing PHP for Yahoo! have some nice graphs).

Basically the realiability is the same on both. Does PHP do what you 
need? Who knows. Does Perl?
You bet you sweet mother it does and a lot more than you probably ever 
thought of.
More FUD.  PHP certainly can do what you want to do.  The question 
(IMHO) is what language are you most comfortable with.  If you're 
starting from scratch, PHP is really hard to beat as a solution to the 
web problem.  It's simple and intuitive and has a shallow learning 
curve.  OTOH, if you already know Perl, and especially if you are 
building on a legacy code-base, Perl is a fine solution as well.

George



--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Php perl?

2003-04-02 Thread Andres L. Figari
as a web server admin I like the way php is a lighter load on the server
than perl is.  Though some would disagree.

I script little and use both ...


- Original Message -
From: "Paul Kraus" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, March 31, 2003 5:12 PM
Subject: Php perl?


> Is perl used to compliment PHP or is perl better to use by itself
> instead of php? How does one relate to the other. I am coming from a
> asp.NET vp.NET .asp vb background and am trying to get away form M$. So
> I am looking at apache php and perl trying to figure out how all the
> pieces fit together.
>
> To show you my ignorance I thought php and apache where the same thing
> :)
>
> Paul
>
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Php perl?

2003-04-02 Thread Dan Muey
This is a cool thread. I'm glad everyone is staying so peaceful about
It. That's another thing I don't like about PHP is that if I was having
this discussion with a PHP person thet'd be insulting me for even considering 
something else. But with Perl everone's just saying, hey Perl does it's 
thing like a tank and if you want to use it great it'll be a loyal pal.
But if you want PHP do that. All of the PHP people I talk to use insults to 
make an argument. Frankly like I said before, if you have to brag about it 
or put others down to make your self look good then it's probably not as big
as you say it is. And the excuse that it's cold right now doesn't do anything.

If your wondering about reliability and stability and fuunctionality ::

Perl has been around a long time.
Perl powers a huge part of the internet, networks, etc...

I even use it on my home computer to keep track of scheduling, data, email etc..

Perl has greater functionality than PHP.

If you want it to run like mod_php use mod_perl. Someone said that not 
using mod_perl "increases dramatically the startup". Yeah by like zillionth of a 
second.

In fact if I run a plain old non mod_perl cgi and the some PHP thing, both doing the 
same 
Exact thing, say parsing a form and emailing it to one person, Then I'd bet that
They were one of two things :: very close to each other in speed, or Perl would be 
faster.

Now add the mod_perl and all is well. 

Basically the realiability is the same on both. Does PHP do what you need? Who knows. 
Does Perl?
You bet you sweet mother it does and a lot more than you probably ever thought of.

> I'd suggest that you look at Jenda's advice also.  Take Perl 
> for what it is.  It works.  Once you get over the difference 
> in paradigm from C-type languages, you will find that P-OOP 
> has it's own  internal logic.

And it feels good in the morning after a good strong coffee! ;p

> 
> Joseph
> 
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Php perl?

2003-04-02 Thread Elias Assmann
On Tue, Apr 01, 2003 at 10:42:57PM -0800, R. Joseph Newton wrote:

> Neither language is strongly typed, as C, Java, or VB are.  Although
> both are type-sensitive, they still restrict identifiers only by
> contaiment class.

Could you elaborate on that? What do you mean by "type-sensitive" and
"restrict identifiers ..."?

-- 
Illiterate? Write for free information.

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [mail_lists] Re: Php perl?

2003-04-02 Thread Jim
On Tuesday 01 April 2003 11:23, Adriano Allora wrote:

This has been an interesting thread.  Here's my take:

I like them both but I prefer Perl.  I use to say that Perl was best for 
application level stuff and PHP was best for web content related stuff.  
However, that kind of thinking is somewhat deprecated now since PHP has done 
some evolving.

I have a friend who is into PHP very much.  Indeed, he is one of those that 
*hates* Perl and *loves* PHP.  Frankly, I don't think he put the time into 
Perl to really appreciate it.  OTH, I find that some people just can't stand 
the way Perl has magic variables, handles regular expressions, and has 
implicit handling of certain things.  I LOVE that about Perl.  It makes 
coding faster imo.

There is only one thing I like better about PHP than Perl.  PHP's OOP seems 
to be more like OOP.  However, for me...I don't do OOP =P  So, on the 
personal level that doesn't mean much to me.

PHP can be used, now, for application level stuff.  This is one of the ways 
PHP has evolved.  But one of the things I do not like about PHP is it's use 
of function calls for everything.  Now, I admit, this is ridiculous because 
ever other language, other than Perl, uses functions for *everything*.  This 
is where Perl has spoiled me.  What am I talking about?

A regular expression in PHP looks like:
preg_match("/<(\w+)(.*?)>(.+)<\/\\1>/s", $data, $regs);

Perl:
/<(\w+)(.*?)>(.+)<\/\\1>/;  # implicit functionality

This is the thing my friend hates and the thing I love.  He blames it on his 
being use to C.  I can understand that.  I have never really seen huge 
resource hits using PHP vs Perl.  I can't say which one uses more resources.  
I suppose it would be a neat test for someone to write a script that does the 
same thing in PHP and Perl and to benchmark it.  Does PHP have a benchmarking 
module yet?

Oh wellto each his own.  I neither hate or love PHP.  I feel it does have 
a place out there in the cyberworld.  It has some good qualities about it.  I 
just love Perl.  I *need* to learn more C.  I have to say that I really like 
the windows PHP documentation (*.chm file).  When I was using Windows that 
was a HUGE plus to PHP.  Is there a such thing for Perl?  I've never seen it.

PHP and Perl kick any microsoft language's butt when it comes to quality, 
security, and ability.

- Jim


| Hi,
| I used to use ASP, then I start to use PHP and now I'm learning perl.
| Perl is more efficent and powerful but also (a bit?) more difficult
| than PHP.
| PHP is a very... comfortable scripting language to develop web-pages
| (similar to ASP, but more easy), and stop there.
| Perl is perfect to do a lot of other activities (I use it to process
| text files).
| They rarely works together.
| If you can, learn both of them!
|
|
| all'adr
|
| Martedì, 1 Apr 2003, alle 03:12 Europe/Rome, Paul Kraus ha scritto:
| > Is perl used to compliment PHP or is perl better to use by itself
| > instead of php? How does one relate to the other. I am coming from a
| > asp.NET vp.NET .asp vb background and am trying to get away form M$. So
| > I am looking at apache php and perl trying to figure out how all the
| > pieces fit together.
| >
| > To show you my ignorance I thought php and apache where the same thing
| >
| > :)
| >
| > Paul
| >
| >
| > --
| > To unsubscribe, e-mail: [EMAIL PROTECTED]
| > For additional commands, e-mail: [EMAIL PROTECTED]

-- 

- Jim

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Php perl?

2003-04-02 Thread Paul Johnson

Jenda Krynicky said:

> From: Rob Richardson <[EMAIL PROTECTED]>
>> My biggest complaint about Perl is the non-intuitive data structures.

>> In C++
>> and Visual Basic, both of which I am employed to write programs in,
>> this is very easy to write, and perhaps more important, it is very
>> easy for somebody else to come along and read and understand what I
>> did.  I have managed to build these structures in Perl, but it's hard
>> for anybody else to understand because the code is so aggressively
>> un-self-documenting.

> Maybe you should stop thinking in C++ when you are programming in
> Perl :-)

> The one thing you just have to get out of your mind is the fixed
> structs. There is (unles you use a module that will restrict you)
> nothing like that in Perl. You can add as many fields as you like at
> any time.

And with great power comes great responsibility.  Getting your data
structures right may well be your most important design decision.  In a
language like C++ this is done upfront and set in stone.  This is good in
that you can count on that data structure being as described, but you have
no run time flexibility.

In Perl there is no requirement to declare your data structures, so it is
important to document them and to discipline yourself to respect them. 
Provide an API if you want others to do the same.

I wouldn't say that Perl's data structures are non-intuitive, although the
ways in which some people use them probably are.  Perl's arrays and hashes
are so powerful that I very rarely have to create my own ADTs (by which I
mean more than just lists of hashes etc.)

And once you start adding subroutines and REs to the data, and allowing
for the option of loading the data at run time, you can end up with really
powerful data driven systems.

As Jenda says, you just need to start thinking in Perl.

-- 
Paul Johnson - [EMAIL PROTECTED]
http://www.pjcj.net


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Php perl?

2003-04-02 Thread Gary Stainburn
On Tuesday 01 April 2003 9:59 pm, Paul Kraus wrote:
> Is one more efficient then the other.
>
> My hesitation with perl (I would like to use is as I already know the
> language) is that coming from a windows environment perl scripts do not
> like to run quickly and having a web server getting hammered and a
> 10,000 processing having to kick off seems to me it have really slow
> down the server. Is php faster then perl (when called from apache or
> IIS) ?

Hi Paul,

Joseph has already covered the choice of platform, an opinion I agree with.

However, to answer the Perl/PHP speed question for you, you need to understand 
how they work.

The PHP interpreter is loaded as an apache module when the process is started. 
It is therefore immediately available to process the PHP pages. 

When apache needs to run a Perl CGI it has to fork/exec/load (or the windows 
equivelent) the perl interpreter and then perl has to compile your script 
before it can be run.  This obviously increases dramatically the startup 
time.  However, it does mean that you script is running in a compiled form 
with the implicit speed improvement that that gives.

Personally, I have found very little difference in speed between Perl CGI's 
and PHP but none of my sites have enough traffic to make it an issue.

There are also ways of getting round the speed problems with Perl.  Apache 
supports mod_perl which is a way of embedding the perl interpreter into 
apache and pre-load/compiling scripts.  In this way the scripts are 
immediately available for use.

(Note: I've never personally used mod_perl so I can't give help on it's use).

Gary


>
> -Original Message-
> From: Dan Muey [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, April 01, 2003 10:02 AM
> To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Subject: RE: Php perl?
>
> > Is perl used to compliment PHP or is perl better to use by
> > itself instead of php? How does one relate to the other. I am
> > coming from a asp.NET vp.NET .asp vb background and am trying
> > to get away form M$. So I am looking at apache php and perl
>
> Apache serves the web pages whether those are html, text, perl, php,
> etc...
>
> What you'll find about perl and php people is that they strongly guard
> 'their language' as the best. I don't find it as bad in the perl
> community but the php community will
> swear up and down how Bad perl is and how much better php is.
>
> In my experience and HO Perl is much more flexible and useful and easy
> to expand. PHP is a bloated little sucker that I've found an irritation
> to deal with on our Servers. Any problems we've had to deal with on our
> server were all regarding php.
>   ( Even Qmail had a breezy installation and configuration )
>
> When a user says, "Hey can you add this to php" it's a stinking
> nightmare but when someone Says "hey I could use this modules" it takes
> the better part of twenty seconds to install it.
>
> You'll probably hear PHP people talk about how great PHP works with
> MySql and how super
> it is at sending Mail and generating images. That one has always
> confused me because if you look at cpan there's Tons of stuff for
> databases, email, and images, and about anythign else you can think of.
>
> So to sum it up ::
>   Try both, use whichever you like.
>   In my experience as a system administrator Perl has been much
> more useful and easy to use, JMHI.
>   Be wary of the way PHP people rip on Perl.
>   ( if you have to brag about it or put others down it's
> not as big as you make it out to be, no? )
>
> I already saw a post describing what they were so I won't get into that.
>
> Oh yeah , the .NET stuff I almost forgot. Perl has all kinds of modules.
> I've never done .NET myself so I'm not sure about it ( check
> http://search.cpan.org ) but there are all kinds of other web service
> stuff. I've used SOAP and WSDL stuff and It works nicely with other
> clients/servers in other languages.
>
> Hope that helps
>
> DMuey
>
> > trying to figure out how all the pieces fit together.
> >
> > To show you my ignorance I thought php and apache where the same thing
> >
> > :)
> >
> > Paul

-- 
Gary Stainburn
 
This email does not contain private or confidential material as it
may be snooped on by interested government parties for unknown
and undisclosed purposes - Regulation of Investigatory Powers Act, 2000 


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Php perl?

2003-04-01 Thread R. Joseph Newton
Paul Kraus wrote:

> Is one more efficient then the other.
>
> My hesitation with perl (I would like to use is as I already know the
> language) is that coming from a windows environment perl scripts do not
> like to run quickly and having a web server getting hammered and a
> 10,000 processing having to kick off seems to me it have really slow
> down the server. Is php faster then perl (when called from apache or
> IIS) ?

Hi Paul,

I wonder whether the issue might really be your choice of web-server platform.  I also 
prefer Windows as a workstation OS.  I certainly wish that I had an NT server 
availbale for user profiles.  Still, I would not make Windows my choice as a file 
server, and I think it is even less suited to the public Internet.  It has too many 
"features" to ever ensure security, and the design priority will always be on adding 
more features.

For a web-server, you are better off with something lean and mean.  Since UIs in 'nix 
are loadable shells, rather than integral to the operating kernel, you can run only 
the functionality needed for your purpose.  You might want to consider whether the 
single-platform approach really serves your needs.  Fro my own part, I would choose:
Windows/Mac as workstation systems
NT Server for managing users workstation profiles and preferences.  [I think it now 
has features to interoperate with AppleTalk.  Just today, I made my first connection 
with a LaserWriter from Win2K.]
Netware, or possibly Samba-'nix, as file server.
Linux as web and firewall server

I would invite you to do some side by side comparisons between any CGI program running 
in Perl on 'nix, and equivalent functionality i mmplemented through ASP.  I know my 
anecdotal evidence indicates very strongly that Perl/Linux will run circles around 
ASP/Windows.

Also, if your procedures involve large data stores, you might want to look closely at 
your storage paradigm.  Does your storage system support high speed access through 
hashing, indexed storage or stable B-Tree trype structures?  Factors like this affect 
speed regardless of language, and almost all general-purpose languages can be used to 
implement any of these techniques.

It might be interesting if you could pick out one or two things that seem to run more 
slowly than they should, and see if there are ways to use Perl's strengths to speed 
them up.  If you do this, though, please first read through the code from the 
perspective of someone not already immersed in the context, and add enough textual 
explanation so that we can get oriented.

Joseph



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Php perl?

2003-04-01 Thread R. Joseph Newton
Rob Richardson wrote:

> Greetings!
>
> My biggest complaint about Perl is the non-intuitive data structures.
> The train schedule program I've been using this list as a resource for
> features a Schedule class that has a collection of ScheduleDay objects,
> each of which has a collection of Train objects, each of which has a
> couple of attributes and an array of crew members.  In C++ and Visual
> Basic, both of which I am employed to write programs in, this is very
> easy to write, and perhaps more important, it is very easy for somebody
> else to come along and read and understand what I did.  I have managed
> to build these structures in Perl, but it's hard for anybody else to
> understand because the code is so aggressively un-self-documenting.
> Does PHP have data structures that are defined in a manner similar to
> C++ or VB?  If so, it would probably be worth my while to learn it.
>
> RobR

Hi Rob,

>From my reading of PHP documentation:

PHP does define classes explicitly, if that is what you mean by data structures.  Once 
declared, also, these classes become types.
PHP does not have any private variables, does have coding conventions that say you 
should not try to address variables beginning with a single underscore.
As for other data structures--PHP use a hash fo for its array type.  If you It can be 
used as either array or hash.  Since the key is required to be unique, numerical 
indexing will work.  You could just as easily declare a string as the index, though.

Neither language is strongly typed, as C, Java, or VB are.  Although both are 
type-sensitive, they still restrict identifiers only by contaiment class.

I'd suggest that you look at Jenda's advice also.  Take Perl for what it is.  It 
works.  Once you get over the difference in paradigm from C-type languages, you will 
find that P-OOP has it's own  internal logic.

Joseph


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Php perl?

2003-04-01 Thread Jenda Krynicky
From: Rob Richardson <[EMAIL PROTECTED]>
> My biggest complaint about Perl is the non-intuitive data structures.
> The train schedule program I've been using this list as a resource for
> features a Schedule class that has a collection of ScheduleDay
> objects, each of which has a collection of Train objects, each of
> which has a couple of attributes and an array of crew members.  In C++
> and Visual Basic, both of which I am employed to write programs in,
> this is very easy to write, and perhaps more important, it is very
> easy for somebody else to come along and read and understand what I
> did.  I have managed to build these structures in Perl, but it's hard
> for anybody else to understand because the code is so aggressively
> un-self-documenting. Does PHP have data structures that are defined in
> a manner similar to C++ or VB?  If so, it would probably be worth my
> while to learn it.

Maybe you should stop thinking in C++ when you are programming in 
Perl :-)


package Schedule;

sub new {
my $class = shift;
my ($this, $that) = @_;
my $self = {
ScheduleDays => [],
this => $this,
that => $that
}
bless $self, $class;
}
# methods go here

package ScheduleDay;

sub new {
my $class = shift;
my $self = {
Trains => [],
something => 'or other',
}
bless $self, $class;
}
# methods go here

package Train;
sub new {
my $class = shift;
my ($name, $teacher) = @_;
my $self = {
Members => [],
Name => $name,
Teacher => $teacher,
}
bless $self, $class;
}
# methods go here

How un-self-documenting is this?

If you want to print the list of members of a Train you use this:

print join(', ', @{$train->{Members}),"\n";

Let's print all trains of a day:

foreach my $train (@{$scheduleday->{Trains}}) {
print "$train->{Name} with $train->{Teacher}\n";
print "\t", join("\n\t", @{$train->{Members}), "\n\n";
}

I admit the bless() looks a bit silly, the Perl calling convention 
may confuse new people, but basicaly this all is very simple.

The one thing you just have to get out of your mind is the fixed 
structs. There is (unles you use a module that will restrict you) 
nothing like that in Perl. You can add as many fields as you like at 
any time. 

Jenda
= [EMAIL PROTECTED] === http://Jenda.Krynicky.cz =
When it comes to wine, women and song, wizards are allowed 
to get drunk and croon as much as they like.
-- Terry Pratchett in Sourcery


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Php perl?

2003-04-01 Thread Bob Showalter
Paul Kraus wrote:
> Is one more efficient then the other.
> 
> My hesitation with perl (I would like to use is as I already know the
> language) is that coming from a windows environment perl scripts do
> not like to run quickly and having a web server getting hammered and a
> 10,000 processing having to kick off seems to me it have really slow
> down the server. 

mod_perl is the answer to that. . I think
ActiveState has a similar gizmo for plugging into IIS (I have no experience
with that).

> Is php faster then perl (when called from apache or IIS) ? 

PHP and mod_perl should be comparable in speed. Both will be faster than
running Perl scripts under mod_cgi.

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Php perl?

2003-04-01 Thread Paul Kraus
Is one more efficient then the other. 

My hesitation with perl (I would like to use is as I already know the
language) is that coming from a windows environment perl scripts do not
like to run quickly and having a web server getting hammered and a
10,000 processing having to kick off seems to me it have really slow
down the server. Is php faster then perl (when called from apache or
IIS) ?

-Original Message-
From: Dan Muey [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, April 01, 2003 10:02 AM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: RE: Php perl?


> Is perl used to compliment PHP or is perl better to use by
> itself instead of php? How does one relate to the other. I am 
> coming from a asp.NET vp.NET .asp vb background and am trying 
> to get away form M$. So I am looking at apache php and perl 

Apache serves the web pages whether those are html, text, perl, php,
etc...

What you'll find about perl and php people is that they strongly guard
'their language' as the best. I don't find it as bad in the perl
community but the php community will 
swear up and down how Bad perl is and how much better php is. 

In my experience and HO Perl is much more flexible and useful and easy
to expand. PHP is a bloated little sucker that I've found an irritation
to deal with on our Servers. Any problems we've had to deal with on our
server were all regarding php. 
( Even Qmail had a breezy installation and configuration )

When a user says, "Hey can you add this to php" it's a stinking
nightmare but when someone Says "hey I could use this modules" it takes
the better part of twenty seconds to install it.

You'll probably hear PHP people talk about how great PHP works with
MySql and how super 
it is at sending Mail and generating images. That one has always
confused me because if you look at cpan there's Tons of stuff for
databases, email, and images, and about anythign else you can think of. 

So to sum it up :: 
Try both, use whichever you like. 
In my experience as a system administrator Perl has been much
more useful and easy to use, JMHI.
Be wary of the way PHP people rip on Perl.
( if you have to brag about it or put others down it's
not as big as you make it out to be, no? )

I already saw a post describing what they were so I won't get into that.

Oh yeah , the .NET stuff I almost forgot. Perl has all kinds of modules.
I've never done .NET myself so I'm not sure about it ( check
http://search.cpan.org ) but there are all kinds of other web service
stuff. I've used SOAP and WSDL stuff and It works nicely with other
clients/servers in other languages.

Hope that helps

DMuey


> trying to figure out how all the pieces fit together.
> 
> To show you my ignorance I thought php and apache where the same thing
> :)
> 
> Paul

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Php perl?

2003-04-01 Thread Dennis G. Wicks
Greetings;

Someone complained about Perl not being self-documenting. As
one who does not know C, C++, VB, Perl, or even Basic very
well, I would like to remind you that any specific computer
language is only self-documenting if you know it!

Good Luck!
Dennis


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Php perl?

2003-04-01 Thread R. Joseph Newton
Paul Kraus wrote:

> Is perl used to compliment PHP

Sure:
#!perl -w

use strict;

print "PHP is a handy-dandy little language for embeding script content in web 
pages\n";   #; :-P

> or is perl better to use by itself
> instead of php? How does one relate to the other. I am coming from a
> asp.NET vp.NET .asp vb background and am trying to get away form M$. So
> I am looking at apache php and perl trying to figure out how all the
> pieces fit together.
>
> To show you my ignorance I thought php and apache where the same thing
> :)
>
> Paul

Hi Paul,

I think the functionalities overlap.  There is probably no reason that you could not 
use both on the same project, but I wouldn't recommend trying to get them to talk to 
each other within any givenprocess.  I'm sure there are interfaces for such purpose, 
but why complicate things?

Since you are a system adminstrator, you would probably be better off using Perl as 
your base language.  It has been around a lot longer, and addresses a much wider range 
of functionalities in its libraries.  On the other hand, there my be particular web 
pages that PHP would be well-suited for,if you want to use embedded code.  You could 
call such a PHP script from a script generated by Perl, and a PHP page may well use a 
Perl script for processing some of its forms.

Feel free to use both.  The syntax of PHP has been closely modeled after that of Perl 
to make transitions between easier.  As a matter of fact, I learned an incredible 
amount about Perl syntax from reading the PHP help reference.

Play around with both.  It never hurts to have one more tool in your kit.

Joseph


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Php perl?

2003-04-01 Thread Dan Muey

> Greetings!

Howdy

> 
> My biggest complaint about Perl is the non-intuitive data structures. 

They're pretty intuitive once you do it a bit!
Perhaps if you posted what you're trying to do here we could all help!

> The train schedule program I've been using this list as a 
> resource for features a Schedule class that has a collection 
> of ScheduleDay objects, each of which has a collection of 
> Train objects, each of which has a couple of attributes and 
> an array of crew members.  In C++ and Visual Basic, both of 
> which I am employed to write programs in, this is very easy 
> to write, and perhaps more important, it is very easy for 
> somebody else to come along and read and understand what I 
> did.  I have managed to build these structures in Perl, but 
> it's hard for anybody else to understand because the code is 
> so aggressively un-self-documenting. 
> Does PHP have data structures that are defined in a manner similar to

Hmm, I don't think so. I could be wron but I don't think so.
 PHP pretty much poops out webpages, sends email, and makes some text into buttons
 and is way behind on other stuff, especially anything very complex.
 ( although the latest version has some shell scripting abilities I hear )
Don't get me wrong PHP has it's place but it just can't do most of 
the things I use perl for.

> C++ or VB?  If so, it would probably be worth my while to learn it.
> 
> RobR
> 
> 
> 
> __
> Do you Yahoo!?
> Yahoo! Tax Center - File online, calculators, forms, and more 
http://platinum.yahoo.com

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Php perl?

2003-04-01 Thread Rob Richardson
Greetings!

My biggest complaint about Perl is the non-intuitive data structures. 
The train schedule program I've been using this list as a resource for
features a Schedule class that has a collection of ScheduleDay objects,
each of which has a collection of Train objects, each of which has a
couple of attributes and an array of crew members.  In C++ and Visual
Basic, both of which I am employed to write programs in, this is very
easy to write, and perhaps more important, it is very easy for somebody
else to come along and read and understand what I did.  I have managed
to build these structures in Perl, but it's hard for anybody else to
understand because the code is so aggressively un-self-documenting. 
Does PHP have data structures that are defined in a manner similar to
C++ or VB?  If so, it would probably be worth my while to learn it.

RobR



__
Do you Yahoo!?
Yahoo! Tax Center - File online, calculators, forms, and more
http://platinum.yahoo.com

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Php perl?

2003-04-01 Thread Adriano Allora
Hi,
I used to use ASP, then I start to use PHP and now I'm learning perl.
Perl is more efficent and powerful but also (a bit?) more difficult 
than PHP.
PHP is a very... comfortable scripting language to develop web-pages 
(similar to ASP, but more easy), and stop there.
Perl is perfect to do a lot of other activities (I use it to process 
text files).
They rarely works together.
If you can, learn both of them!

all'adr



Martedì, 1 Apr 2003, alle 03:12 Europe/Rome, Paul Kraus ha scritto:

Is perl used to compliment PHP or is perl better to use by itself
instead of php? How does one relate to the other. I am coming from a
asp.NET vp.NET .asp vb background and am trying to get away form M$. So
I am looking at apache php and perl trying to figure out how all the
pieces fit together.
To show you my ignorance I thought php and apache where the same thing
:)
Paul

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: Php perl?

2003-04-01 Thread Dan Muey
> Is perl used to compliment PHP or is perl better to use by 
> itself instead of php? How does one relate to the other. I am 
> coming from a asp.NET vp.NET .asp vb background and am trying 
> to get away form M$. So I am looking at apache php and perl 

Apache serves the web pages whether those are html, text, perl, php, etc...

What you'll find about perl and php people is that they strongly guard 'their language'
as the best. I don't find it as bad in the perl community but the php community will 
swear up and down how Bad perl is and how much better php is. 

In my experience and HO Perl is much more flexible and useful and easy to expand.
PHP is a bloated little sucker that I've found an irritation to deal with on our
Servers. Any problems we've had to deal with on our server were all regarding php. 
( Even Qmail had a breezy installation and configuration )

When a user says, "Hey can you add this to php" it's a stinking nightmare but when 
someone
Says "hey I could use this modules" it takes the better part of twenty seconds to 
install it.

You'll probably hear PHP people talk about how great PHP works with MySql and how 
super 
it is at sending Mail and generating images. That one has always confused me because 
if you look at cpan there's
Tons of stuff for databases, email, and images, and about anythign else you can think 
of. 

So to sum it up :: 
Try both, use whichever you like. 
In my experience as a system administrator Perl has been much more useful and 
easy to use, JMHI.
Be wary of the way PHP people rip on Perl.
( if you have to brag about it or put others down it's not as big as 
you make it out to be, no? )

I already saw a post describing what they were so I won't get into that.

Oh yeah , the .NET stuff I almost forgot. Perl has all kinds of modules. I've never 
done .NET myself so I'm not sure about it ( check http://search.cpan.org ) but there 
are all kinds of other web service stuff. I've used SOAP and WSDL stuff and
It works nicely with other clients/servers in other languages.

Hope that helps

DMuey


> trying to figure out how all the pieces fit together. 
> 
> To show you my ignorance I thought php and apache where the same thing
> :)
> 
> Paul

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Php perl?

2003-04-01 Thread Francesco del Vecchio
Hi Paul,

your question is not so easy to reply...but I'll try.

The difference between the PHP and the Perl could sound as the difference between ASP 
and
VisualBasic. 
While ASP il interpreted by the WEB-Server itself, so you can mix-up HTML code with 
your ASP code,
Visual Basic is a 'stand alone' language, but you can use it to generate HTML pages 
too.

So, PHP sound like ASP...you can mix it with the HTML code and the Webserver will 
interpret
it...Perl is a language 'stand-alone', it is a "general purpose language". It's great 
features in
"string manipulation" make it a great language for Hipertestual document manipulation. 
That's why
it is largely used in the Web.

I'm a beginner in both Perl & PHP...as you I come from the MS World, but I prefer Perl 
for the
large support and for the great number of modules I can count on.

What I say is just a simple introduction...most skilled person can add detail to this 
response

Good Perl! ^_^

Francesco
--- Paul Kraus <[EMAIL PROTECTED]> wrote:
> Is perl used to compliment PHP or is perl better to use by itself
> instead of php? How does one relate to the other. I am coming from a
> asp.NET vp.NET .asp vb background and am trying to get away form M$. So
> I am looking at apache php and perl trying to figure out how all the
> pieces fit together. 
> 
> To show you my ignorance I thought php and apache where the same thing
> :)
> 
> Paul
> 
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


__
Do you Yahoo!?
Yahoo! Tax Center - File online, calculators, forms, and more
http://platinum.yahoo.com

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Php perl?

2003-03-31 Thread Paul Kraus
Is perl used to compliment PHP or is perl better to use by itself
instead of php? How does one relate to the other. I am coming from a
asp.NET vp.NET .asp vb background and am trying to get away form M$. So
I am looking at apache php and perl trying to figure out how all the
pieces fit together. 

To show you my ignorance I thought php and apache where the same thing
:)

Paul


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: php -> perl

2001-06-14 Thread Hasanuddin Tamir

On Wed, 13 Jun 2001, Michael Cartwright <[EMAIL PROTECTED]> wrote,

> However, I need it in Perl. Could someone help me with what would this look
> like in Perl?
>
> Thanks,
> Michael
>
>   $FileName=$HTTP_GET_VARS["FileName"];
>
>  if(!$FileName)
>  {
>   $FileName="example";
>  }
>  $FileName.=".opx";
>  header("Content-type: application/x-opx");
>  readfile($FileName);
> ?>

#!/usr/bin/perl -w

use strict;
use CGI ':standard';

my $file = param('FileName') || 'example';
$file .= '.opx';

if (open OPX, $file) {
print header(type => 'application/x-opx');
print ;
close OPX;
}
else {
print
header,
start_html('Error'),
b('Sorry, got problem when showing the content'),
end_html;
print STDERR "failed to read $file: $!\n"; # goes to error log
}

__END__

-- 
s::a::n->http(www.trabas.com)




php -> perl

2001-06-13 Thread Michael Cartwright

Hi all,

The point of this script is to get arround setting application MIME types on
the server for when you don't have the right to do that on your server. It
will fetch any file as any MIME type. It adds the file extension and
defaults to "example.opx" if there is no filename given.

However, I need it in Perl. Could someone help me with what would this look
like in Perl?

Thanks,
Michael