Domain: cpan.org
Stories and comments across the archive that link to cpan.org.
Comments · 1,172
-
Re:Phppwhat exactly what can you do with perl that you can't do with php???
A few examples:
Parse and create binary Excel files, even on Unix?
Automate your smart home?
Configure a linux packet-filtering firewall?
Monitor SNMP devices across the enterprise?
Perform various System Administration tasks?
Program using the Win32 API?
Write for extra speed?
Write native GUI apps in windows or unix/linux?
There are over 4000 other reasons in the module repository known as CPAN.
I use several languages, but when I want to be productive, I turn to Perl because of CPAN. Generally, I have 80% of my code nicely abstracted in object-oriented modules. (Note to OO purists: bugger off, we're comparing to PHP not Scheme or Eiffel or whatever)
-
Re:Phppwhat exactly what can you do with perl that you can't do with php???
A few examples:
Parse and create binary Excel files, even on Unix?
Automate your smart home?
Configure a linux packet-filtering firewall?
Monitor SNMP devices across the enterprise?
Perform various System Administration tasks?
Program using the Win32 API?
Write for extra speed?
Write native GUI apps in windows or unix/linux?
There are over 4000 other reasons in the module repository known as CPAN.
I use several languages, but when I want to be productive, I turn to Perl because of CPAN. Generally, I have 80% of my code nicely abstracted in object-oriented modules. (Note to OO purists: bugger off, we're comparing to PHP not Scheme or Eiffel or whatever)
-
Re:Phppwhat exactly what can you do with perl that you can't do with php???
A few examples:
Parse and create binary Excel files, even on Unix?
Automate your smart home?
Configure a linux packet-filtering firewall?
Monitor SNMP devices across the enterprise?
Perform various System Administration tasks?
Program using the Win32 API?
Write for extra speed?
Write native GUI apps in windows or unix/linux?
There are over 4000 other reasons in the module repository known as CPAN.
I use several languages, but when I want to be productive, I turn to Perl because of CPAN. Generally, I have 80% of my code nicely abstracted in object-oriented modules. (Note to OO purists: bugger off, we're comparing to PHP not Scheme or Eiffel or whatever)
-
Re:Phppwhat exactly what can you do with perl that you can't do with php???
A few examples:
Parse and create binary Excel files, even on Unix?
Automate your smart home?
Configure a linux packet-filtering firewall?
Monitor SNMP devices across the enterprise?
Perform various System Administration tasks?
Program using the Win32 API?
Write for extra speed?
Write native GUI apps in windows or unix/linux?
There are over 4000 other reasons in the module repository known as CPAN.
I use several languages, but when I want to be productive, I turn to Perl because of CPAN. Generally, I have 80% of my code nicely abstracted in object-oriented modules. (Note to OO purists: bugger off, we're comparing to PHP not Scheme or Eiffel or whatever)
-
Re:Phppwhat exactly what can you do with perl that you can't do with php???
A few examples:
Parse and create binary Excel files, even on Unix?
Automate your smart home?
Configure a linux packet-filtering firewall?
Monitor SNMP devices across the enterprise?
Perform various System Administration tasks?
Program using the Win32 API?
Write for extra speed?
Write native GUI apps in windows or unix/linux?
There are over 4000 other reasons in the module repository known as CPAN.
I use several languages, but when I want to be productive, I turn to Perl because of CPAN. Generally, I have 80% of my code nicely abstracted in object-oriented modules. (Note to OO purists: bugger off, we're comparing to PHP not Scheme or Eiffel or whatever)
-
Re:Phppwhat exactly what can you do with perl that you can't do with php???
A few examples:
Parse and create binary Excel files, even on Unix?
Automate your smart home?
Configure a linux packet-filtering firewall?
Monitor SNMP devices across the enterprise?
Perform various System Administration tasks?
Program using the Win32 API?
Write for extra speed?
Write native GUI apps in windows or unix/linux?
There are over 4000 other reasons in the module repository known as CPAN.
I use several languages, but when I want to be productive, I turn to Perl because of CPAN. Generally, I have 80% of my code nicely abstracted in object-oriented modules. (Note to OO purists: bugger off, we're comparing to PHP not Scheme or Eiffel or whatever)
-
Re:Phppwhat exactly what can you do with perl that you can't do with php???
A few examples:
Parse and create binary Excel files, even on Unix?
Automate your smart home?
Configure a linux packet-filtering firewall?
Monitor SNMP devices across the enterprise?
Perform various System Administration tasks?
Program using the Win32 API?
Write for extra speed?
Write native GUI apps in windows or unix/linux?
There are over 4000 other reasons in the module repository known as CPAN.
I use several languages, but when I want to be productive, I turn to Perl because of CPAN. Generally, I have 80% of my code nicely abstracted in object-oriented modules. (Note to OO purists: bugger off, we're comparing to PHP not Scheme or Eiffel or whatever)
-
Re:Phppwhat exactly what can you do with perl that you can't do with php???
A few examples:
Parse and create binary Excel files, even on Unix?
Automate your smart home?
Configure a linux packet-filtering firewall?
Monitor SNMP devices across the enterprise?
Perform various System Administration tasks?
Program using the Win32 API?
Write for extra speed?
Write native GUI apps in windows or unix/linux?
There are over 4000 other reasons in the module repository known as CPAN.
I use several languages, but when I want to be productive, I turn to Perl because of CPAN. Generally, I have 80% of my code nicely abstracted in object-oriented modules. (Note to OO purists: bugger off, we're comparing to PHP not Scheme or Eiffel or whatever)
-
Re:Phppwhat exactly what can you do with perl that you can't do with php???
A few examples:
Parse and create binary Excel files, even on Unix?
Automate your smart home?
Configure a linux packet-filtering firewall?
Monitor SNMP devices across the enterprise?
Perform various System Administration tasks?
Program using the Win32 API?
Write for extra speed?
Write native GUI apps in windows or unix/linux?
There are over 4000 other reasons in the module repository known as CPAN.
I use several languages, but when I want to be productive, I turn to Perl because of CPAN. Generally, I have 80% of my code nicely abstracted in object-oriented modules. (Note to OO purists: bugger off, we're comparing to PHP not Scheme or Eiffel or whatever)
-
Re:Phppwhat exactly what can you do with perl that you can't do with php???
A few examples:
Parse and create binary Excel files, even on Unix?
Automate your smart home?
Configure a linux packet-filtering firewall?
Monitor SNMP devices across the enterprise?
Perform various System Administration tasks?
Program using the Win32 API?
Write for extra speed?
Write native GUI apps in windows or unix/linux?
There are over 4000 other reasons in the module repository known as CPAN.
I use several languages, but when I want to be productive, I turn to Perl because of CPAN. Generally, I have 80% of my code nicely abstracted in object-oriented modules. (Note to OO purists: bugger off, we're comparing to PHP not Scheme or Eiffel or whatever)
-
Re:The evolution of languages
Now, I'm walking a semantic line here, because you can presumably do all that by writing header files, includes, classes, etc. that contain new logic within the structure of the language. But what I mean is a language that by its nature is abstracted and modular, even to the point where the syntax of, say, control structures could be modified in a module?
I am interested in exactly this. It would be nice if regular expressions were simple a syntactical plugin to the language. Extensions could make it easier to specify things that don't quite fit the existing function/expression syntax.
So far, the only example of this I have found is Perl. Though I'm not sure exactly how it is done, I believe that the interpreter just delegates control to a custom parser. The Perl 'Switch' statement is/was implemented this way. You may also have heard of the extension that lets you (kind of) code Perl using Latin (written by the same guy).
-
Re:IP-based lookup
Here's another Perl Module for looking up IP address based on country. This one requires a C library, and there is a slower one that is pure perl here.
The basic IP to country database is free and updated monthly. -
Re:IP-based lookup
Here's another Perl Module for looking up IP address based on country. This one requires a C library, and there is a slower one that is pure perl here.
The basic IP to country database is free and updated monthly. -
IP-based lookup
The site is slashdotted, so I haven't been able to have a look at it. However, if I were building a geo-search engine, I'd use the WHOIS data for the bulk of the indexing work, and for providing a default location for visitors. The tweaking around the edges (changing the location of the website or page), is just icing on the cake.
No one really knows the accuracy of IP->Country lookup. There's an onlgoing thread on the london perl mongers list about this topic. Some geolocation companies state 98% accuracy, which is pure bullshit. It's more likely to be around 70%, with most of the error occuring in overestimation of US addresses.
By the way, if you want a fast IP locator, here's one that's just as accurate as any of the commercial products. I'm surprised more people don't use this sort of stuff for providing intelligent defaults for their users when filling in HTML forms.
-
Insightful? (was: Re:Fonts That Don't Suck!)whoever modded parent insightful should be drag out into the street and shot.
why don't you leave tech stuff to those actually running X?
Uhhhh. What is "PERL"?
where did you try to look?
this currently gives the most important sites within the first result set (by the way: why does mysql.com score so high?). i'd like to propose using lower case unless you know better.
removing X (yes X!) from any given dist (which uses it) is relatively easy [i do so on old hardware == small budget and for the pro look *g*], removing perl (if it is in default install) is a lot more of a problem. coding in perl is fast (and dirty), the amount of modules is amazing.
Apache: granted, this one should not be in any desktop default. it seems quite common (for dists) to use it to display html docs on a webserver rather than out of the the filesystem. this might be acceptable use with a lightweight alternative (e.g. boa) but apache mem footprint is to large for my taste.
mysql: this is a true database (not Excel or Access). it may not be (an) oracle, but it already contains a lot of heavy (at least for me) math, as such i find it interesting. sql (meaning the language) is quite easy to understand and use (perl is a good one for this, as it is so easy on strings). MS is thinking about moving the entire(?) filesystem into a database, and some projects (here a rpg) are already using it, more a sure to follow. though i prefer postgres.
php: diversity has it's prize (megs=harddisk=money), but one could (probably) not install anything depending on php.
if you do use a http server and mysql, php is needed to support phpmyadmin (and you probably do want this one).
about x11: the thread says it all: either there is a hardware problem, or you are talking about something other than x. it may include some quite old source, but so does windows (and mac-os is gone). creating a graphical windows system (with support available for hardware built before me up till the latest 3d hardware cards) is quite some project, though indeed there is an alternative ftp://ftp.linux.org.uk/pub/linux/alan/Software/Obs olete/Mini-X/, but most probably not what you want. -
Re:Why I prefer PHP to Perl
Well since someone modded up the troll I suppose I should reply to it.
* Ease of use.
I started with Perl, I was writting web pages in a day with it. Maybe it depends on the teacher.
* The OO of PHP is excellent. In my experience, it rivals Smalltalk. We all know that Perl's OO still needs work
I use PHP, I have yet to see a reason to do much OO in what is primarily a web scripting language to embed in an HTML page. What I have seen seems incomplete and difficult to use. Contrast to Perl which while it may not be as feature complete as say Java or Smalltalk it is certainly easy to use and I think it has the right principles behind it. Especially after Perl 5.6. As far is PHP being as good as Smalltalk at OO, I have my doubts but I can't say for sure as I don't program in Smalltalk.
* Outstanding database support. PHP supports virtually every DB under the sun (although Berkeley DB is missing, oddly enough.) Perl seems limited to MySQL and PostgreSQL, and its really a kludge for the later. I've heard that this will be fixed in upcoming versions of Perl though.
This is simply untrue, Perl supports tons of databases through the DBI (which is also fairly simple to write new drivers for if you need them) and even if there isn't a native DBI driver, DBI supports ODBC and you can use any database that has it. That's certainly far more than just MySql and Postgres. I think your description of databases in Perl fits better for databases under PHP especially before PHP 4.
* Portability. I can take PHP code off my Linux box and plop it onto an IIS server, or even one of those new Macintosh servers and have it run without having to change a single line of code. Try doing this with Perl! Its as though it was written in assembly, Perl requires
that much rewriting.
FUD. It depends on what you do. Last I saw Perl has been ported to every major platform except Palm. Contrast to PHP which is on what Linux and Windows? Okay maybe some other Unixes. Perl is on dozens of Unixes, OS/2, Windows, MacOS (Before OSX), and I even had a friend using it on VMS and I also think there's even a DOS version. Some networking features used to have issues on windows but that's been fixed now with emulation
* Speed. PHP is one of the fastest languages I've ever used. While it won't be replacing assembly or C, its definitely faster than Perl in almost every case, particularly in regex which has long been Perl's
strongest point. I'm sure there are cases where Perl is equal to PHP, but I can't think of any at the moment.
If your using if for administration scripts and text processing I don't know if Perl is faster or not, but for that sort of thing I doubt there is enough difference to care and i can't imagine how annoying it would be to try writting that sort of thing in PHP. (That's just personal preference though) ... On the web PHP beats a CGI script written in Perl because PHP is normally compiled into the server. Using mod_perl fixes this problem and gives you the power of Perl with equal or greater speed... I'm not going to say one is faster than the other because benchmarks are very subjective. Finally as I understand it, mod_perl scales better.
* Graphics. PHP comes with a nice little graphics library. While I wouldn't use its to code the new Doom (VB would be a better choice) its adequate for most web pages, and should be considered as a substitute for Flash for certain things. Perl lacks a graphics library
of any kind.
More FUD: How about OpenGL or maybe the GD library (which is what PHP uses). Oh yeah there's even a Gimp Perl interface. Not to mention SDL tie in and several others. In fact if you go to CPAN Search frontpage there is a link that says "Graphics" which lists several common ones.
The fact that these are not in the core language is a good thing. PHP's braindead way of putting everything_in_the_same_namespace() gets really old.
* Data Structures. Perl has references which can point to sub routines, arrays hashes or other contants or scalars. You can also muck around with the underlying GLOBS and there are a bunch of B::* modules for mucking around with internals as well. I certain that you can probably accomplish the same things using those tools. However even if you can't when do you need that sort of thing in a website? I think that if I need a data structure that complex I'll write it in C.
IMHO PHP will be good when the developers stop dumping one hacked subroutine after another into the core of the language. When they fix interpolation which is a nightmare (works sometimes and other times doesn't???), when new versions quit breaking existing code and when they build in better support for system wide modules and add ons.
If Perl has nothing else it still has CPAN nothing PHP has even comes close to the amount of add-ons and extras that are easy to find and just work. -
Re:Why I prefer PHP to Perl
Well since someone modded up the troll I suppose I should reply to it.
* Ease of use.
I started with Perl, I was writting web pages in a day with it. Maybe it depends on the teacher.
* The OO of PHP is excellent. In my experience, it rivals Smalltalk. We all know that Perl's OO still needs work
I use PHP, I have yet to see a reason to do much OO in what is primarily a web scripting language to embed in an HTML page. What I have seen seems incomplete and difficult to use. Contrast to Perl which while it may not be as feature complete as say Java or Smalltalk it is certainly easy to use and I think it has the right principles behind it. Especially after Perl 5.6. As far is PHP being as good as Smalltalk at OO, I have my doubts but I can't say for sure as I don't program in Smalltalk.
* Outstanding database support. PHP supports virtually every DB under the sun (although Berkeley DB is missing, oddly enough.) Perl seems limited to MySQL and PostgreSQL, and its really a kludge for the later. I've heard that this will be fixed in upcoming versions of Perl though.
This is simply untrue, Perl supports tons of databases through the DBI (which is also fairly simple to write new drivers for if you need them) and even if there isn't a native DBI driver, DBI supports ODBC and you can use any database that has it. That's certainly far more than just MySql and Postgres. I think your description of databases in Perl fits better for databases under PHP especially before PHP 4.
* Portability. I can take PHP code off my Linux box and plop it onto an IIS server, or even one of those new Macintosh servers and have it run without having to change a single line of code. Try doing this with Perl! Its as though it was written in assembly, Perl requires
that much rewriting.
FUD. It depends on what you do. Last I saw Perl has been ported to every major platform except Palm. Contrast to PHP which is on what Linux and Windows? Okay maybe some other Unixes. Perl is on dozens of Unixes, OS/2, Windows, MacOS (Before OSX), and I even had a friend using it on VMS and I also think there's even a DOS version. Some networking features used to have issues on windows but that's been fixed now with emulation
* Speed. PHP is one of the fastest languages I've ever used. While it won't be replacing assembly or C, its definitely faster than Perl in almost every case, particularly in regex which has long been Perl's
strongest point. I'm sure there are cases where Perl is equal to PHP, but I can't think of any at the moment.
If your using if for administration scripts and text processing I don't know if Perl is faster or not, but for that sort of thing I doubt there is enough difference to care and i can't imagine how annoying it would be to try writting that sort of thing in PHP. (That's just personal preference though) ... On the web PHP beats a CGI script written in Perl because PHP is normally compiled into the server. Using mod_perl fixes this problem and gives you the power of Perl with equal or greater speed... I'm not going to say one is faster than the other because benchmarks are very subjective. Finally as I understand it, mod_perl scales better.
* Graphics. PHP comes with a nice little graphics library. While I wouldn't use its to code the new Doom (VB would be a better choice) its adequate for most web pages, and should be considered as a substitute for Flash for certain things. Perl lacks a graphics library
of any kind.
More FUD: How about OpenGL or maybe the GD library (which is what PHP uses). Oh yeah there's even a Gimp Perl interface. Not to mention SDL tie in and several others. In fact if you go to CPAN Search frontpage there is a link that says "Graphics" which lists several common ones.
The fact that these are not in the core language is a good thing. PHP's braindead way of putting everything_in_the_same_namespace() gets really old.
* Data Structures. Perl has references which can point to sub routines, arrays hashes or other contants or scalars. You can also muck around with the underlying GLOBS and there are a bunch of B::* modules for mucking around with internals as well. I certain that you can probably accomplish the same things using those tools. However even if you can't when do you need that sort of thing in a website? I think that if I need a data structure that complex I'll write it in C.
IMHO PHP will be good when the developers stop dumping one hacked subroutine after another into the core of the language. When they fix interpolation which is a nightmare (works sometimes and other times doesn't???), when new versions quit breaking existing code and when they build in better support for system wide modules and add ons.
If Perl has nothing else it still has CPAN nothing PHP has even comes close to the amount of add-ons and extras that are easy to find and just work. -
Re:Why I prefer PHP to Perl
Well since someone modded up the troll I suppose I should reply to it.
* Ease of use.
I started with Perl, I was writting web pages in a day with it. Maybe it depends on the teacher.
* The OO of PHP is excellent. In my experience, it rivals Smalltalk. We all know that Perl's OO still needs work
I use PHP, I have yet to see a reason to do much OO in what is primarily a web scripting language to embed in an HTML page. What I have seen seems incomplete and difficult to use. Contrast to Perl which while it may not be as feature complete as say Java or Smalltalk it is certainly easy to use and I think it has the right principles behind it. Especially after Perl 5.6. As far is PHP being as good as Smalltalk at OO, I have my doubts but I can't say for sure as I don't program in Smalltalk.
* Outstanding database support. PHP supports virtually every DB under the sun (although Berkeley DB is missing, oddly enough.) Perl seems limited to MySQL and PostgreSQL, and its really a kludge for the later. I've heard that this will be fixed in upcoming versions of Perl though.
This is simply untrue, Perl supports tons of databases through the DBI (which is also fairly simple to write new drivers for if you need them) and even if there isn't a native DBI driver, DBI supports ODBC and you can use any database that has it. That's certainly far more than just MySql and Postgres. I think your description of databases in Perl fits better for databases under PHP especially before PHP 4.
* Portability. I can take PHP code off my Linux box and plop it onto an IIS server, or even one of those new Macintosh servers and have it run without having to change a single line of code. Try doing this with Perl! Its as though it was written in assembly, Perl requires
that much rewriting.
FUD. It depends on what you do. Last I saw Perl has been ported to every major platform except Palm. Contrast to PHP which is on what Linux and Windows? Okay maybe some other Unixes. Perl is on dozens of Unixes, OS/2, Windows, MacOS (Before OSX), and I even had a friend using it on VMS and I also think there's even a DOS version. Some networking features used to have issues on windows but that's been fixed now with emulation
* Speed. PHP is one of the fastest languages I've ever used. While it won't be replacing assembly or C, its definitely faster than Perl in almost every case, particularly in regex which has long been Perl's
strongest point. I'm sure there are cases where Perl is equal to PHP, but I can't think of any at the moment.
If your using if for administration scripts and text processing I don't know if Perl is faster or not, but for that sort of thing I doubt there is enough difference to care and i can't imagine how annoying it would be to try writting that sort of thing in PHP. (That's just personal preference though) ... On the web PHP beats a CGI script written in Perl because PHP is normally compiled into the server. Using mod_perl fixes this problem and gives you the power of Perl with equal or greater speed... I'm not going to say one is faster than the other because benchmarks are very subjective. Finally as I understand it, mod_perl scales better.
* Graphics. PHP comes with a nice little graphics library. While I wouldn't use its to code the new Doom (VB would be a better choice) its adequate for most web pages, and should be considered as a substitute for Flash for certain things. Perl lacks a graphics library
of any kind.
More FUD: How about OpenGL or maybe the GD library (which is what PHP uses). Oh yeah there's even a Gimp Perl interface. Not to mention SDL tie in and several others. In fact if you go to CPAN Search frontpage there is a link that says "Graphics" which lists several common ones.
The fact that these are not in the core language is a good thing. PHP's braindead way of putting everything_in_the_same_namespace() gets really old.
* Data Structures. Perl has references which can point to sub routines, arrays hashes or other contants or scalars. You can also muck around with the underlying GLOBS and there are a bunch of B::* modules for mucking around with internals as well. I certain that you can probably accomplish the same things using those tools. However even if you can't when do you need that sort of thing in a website? I think that if I need a data structure that complex I'll write it in C.
IMHO PHP will be good when the developers stop dumping one hacked subroutine after another into the core of the language. When they fix interpolation which is a nightmare (works sometimes and other times doesn't???), when new versions quit breaking existing code and when they build in better support for system wide modules and add ons.
If Perl has nothing else it still has CPAN nothing PHP has even comes close to the amount of add-ons and extras that are easy to find and just work. -
Re:Why I prefer PHP to Perl
Well since someone modded up the troll I suppose I should reply to it.
* Ease of use.
I started with Perl, I was writting web pages in a day with it. Maybe it depends on the teacher.
* The OO of PHP is excellent. In my experience, it rivals Smalltalk. We all know that Perl's OO still needs work
I use PHP, I have yet to see a reason to do much OO in what is primarily a web scripting language to embed in an HTML page. What I have seen seems incomplete and difficult to use. Contrast to Perl which while it may not be as feature complete as say Java or Smalltalk it is certainly easy to use and I think it has the right principles behind it. Especially after Perl 5.6. As far is PHP being as good as Smalltalk at OO, I have my doubts but I can't say for sure as I don't program in Smalltalk.
* Outstanding database support. PHP supports virtually every DB under the sun (although Berkeley DB is missing, oddly enough.) Perl seems limited to MySQL and PostgreSQL, and its really a kludge for the later. I've heard that this will be fixed in upcoming versions of Perl though.
This is simply untrue, Perl supports tons of databases through the DBI (which is also fairly simple to write new drivers for if you need them) and even if there isn't a native DBI driver, DBI supports ODBC and you can use any database that has it. That's certainly far more than just MySql and Postgres. I think your description of databases in Perl fits better for databases under PHP especially before PHP 4.
* Portability. I can take PHP code off my Linux box and plop it onto an IIS server, or even one of those new Macintosh servers and have it run without having to change a single line of code. Try doing this with Perl! Its as though it was written in assembly, Perl requires
that much rewriting.
FUD. It depends on what you do. Last I saw Perl has been ported to every major platform except Palm. Contrast to PHP which is on what Linux and Windows? Okay maybe some other Unixes. Perl is on dozens of Unixes, OS/2, Windows, MacOS (Before OSX), and I even had a friend using it on VMS and I also think there's even a DOS version. Some networking features used to have issues on windows but that's been fixed now with emulation
* Speed. PHP is one of the fastest languages I've ever used. While it won't be replacing assembly or C, its definitely faster than Perl in almost every case, particularly in regex which has long been Perl's
strongest point. I'm sure there are cases where Perl is equal to PHP, but I can't think of any at the moment.
If your using if for administration scripts and text processing I don't know if Perl is faster or not, but for that sort of thing I doubt there is enough difference to care and i can't imagine how annoying it would be to try writting that sort of thing in PHP. (That's just personal preference though) ... On the web PHP beats a CGI script written in Perl because PHP is normally compiled into the server. Using mod_perl fixes this problem and gives you the power of Perl with equal or greater speed... I'm not going to say one is faster than the other because benchmarks are very subjective. Finally as I understand it, mod_perl scales better.
* Graphics. PHP comes with a nice little graphics library. While I wouldn't use its to code the new Doom (VB would be a better choice) its adequate for most web pages, and should be considered as a substitute for Flash for certain things. Perl lacks a graphics library
of any kind.
More FUD: How about OpenGL or maybe the GD library (which is what PHP uses). Oh yeah there's even a Gimp Perl interface. Not to mention SDL tie in and several others. In fact if you go to CPAN Search frontpage there is a link that says "Graphics" which lists several common ones.
The fact that these are not in the core language is a good thing. PHP's braindead way of putting everything_in_the_same_namespace() gets really old.
* Data Structures. Perl has references which can point to sub routines, arrays hashes or other contants or scalars. You can also muck around with the underlying GLOBS and there are a bunch of B::* modules for mucking around with internals as well. I certain that you can probably accomplish the same things using those tools. However even if you can't when do you need that sort of thing in a website? I think that if I need a data structure that complex I'll write it in C.
IMHO PHP will be good when the developers stop dumping one hacked subroutine after another into the core of the language. When they fix interpolation which is a nightmare (works sometimes and other times doesn't???), when new versions quit breaking existing code and when they build in better support for system wide modules and add ons.
If Perl has nothing else it still has CPAN nothing PHP has even comes close to the amount of add-ons and extras that are easy to find and just work. -
Re:Why I prefer PHP to Perl
Well since someone modded up the troll I suppose I should reply to it.
* Ease of use.
I started with Perl, I was writting web pages in a day with it. Maybe it depends on the teacher.
* The OO of PHP is excellent. In my experience, it rivals Smalltalk. We all know that Perl's OO still needs work
I use PHP, I have yet to see a reason to do much OO in what is primarily a web scripting language to embed in an HTML page. What I have seen seems incomplete and difficult to use. Contrast to Perl which while it may not be as feature complete as say Java or Smalltalk it is certainly easy to use and I think it has the right principles behind it. Especially after Perl 5.6. As far is PHP being as good as Smalltalk at OO, I have my doubts but I can't say for sure as I don't program in Smalltalk.
* Outstanding database support. PHP supports virtually every DB under the sun (although Berkeley DB is missing, oddly enough.) Perl seems limited to MySQL and PostgreSQL, and its really a kludge for the later. I've heard that this will be fixed in upcoming versions of Perl though.
This is simply untrue, Perl supports tons of databases through the DBI (which is also fairly simple to write new drivers for if you need them) and even if there isn't a native DBI driver, DBI supports ODBC and you can use any database that has it. That's certainly far more than just MySql and Postgres. I think your description of databases in Perl fits better for databases under PHP especially before PHP 4.
* Portability. I can take PHP code off my Linux box and plop it onto an IIS server, or even one of those new Macintosh servers and have it run without having to change a single line of code. Try doing this with Perl! Its as though it was written in assembly, Perl requires
that much rewriting.
FUD. It depends on what you do. Last I saw Perl has been ported to every major platform except Palm. Contrast to PHP which is on what Linux and Windows? Okay maybe some other Unixes. Perl is on dozens of Unixes, OS/2, Windows, MacOS (Before OSX), and I even had a friend using it on VMS and I also think there's even a DOS version. Some networking features used to have issues on windows but that's been fixed now with emulation
* Speed. PHP is one of the fastest languages I've ever used. While it won't be replacing assembly or C, its definitely faster than Perl in almost every case, particularly in regex which has long been Perl's
strongest point. I'm sure there are cases where Perl is equal to PHP, but I can't think of any at the moment.
If your using if for administration scripts and text processing I don't know if Perl is faster or not, but for that sort of thing I doubt there is enough difference to care and i can't imagine how annoying it would be to try writting that sort of thing in PHP. (That's just personal preference though) ... On the web PHP beats a CGI script written in Perl because PHP is normally compiled into the server. Using mod_perl fixes this problem and gives you the power of Perl with equal or greater speed... I'm not going to say one is faster than the other because benchmarks are very subjective. Finally as I understand it, mod_perl scales better.
* Graphics. PHP comes with a nice little graphics library. While I wouldn't use its to code the new Doom (VB would be a better choice) its adequate for most web pages, and should be considered as a substitute for Flash for certain things. Perl lacks a graphics library
of any kind.
More FUD: How about OpenGL or maybe the GD library (which is what PHP uses). Oh yeah there's even a Gimp Perl interface. Not to mention SDL tie in and several others. In fact if you go to CPAN Search frontpage there is a link that says "Graphics" which lists several common ones.
The fact that these are not in the core language is a good thing. PHP's braindead way of putting everything_in_the_same_namespace() gets really old.
* Data Structures. Perl has references which can point to sub routines, arrays hashes or other contants or scalars. You can also muck around with the underlying GLOBS and there are a bunch of B::* modules for mucking around with internals as well. I certain that you can probably accomplish the same things using those tools. However even if you can't when do you need that sort of thing in a website? I think that if I need a data structure that complex I'll write it in C.
IMHO PHP will be good when the developers stop dumping one hacked subroutine after another into the core of the language. When they fix interpolation which is a nightmare (works sometimes and other times doesn't???), when new versions quit breaking existing code and when they build in better support for system wide modules and add ons.
If Perl has nothing else it still has CPAN nothing PHP has even comes close to the amount of add-ons and extras that are easy to find and just work. -
Re:PHP resolves some shortcomings of Perl
I won't get into PHP-vs-Perl, as I think the two complement eachother nicely (if you realy know how to use mod_perl and PHP, you can do some amazing things with the Web which are not idealy suited to either one).
However, you are incorrect on some points:
Outstanding database support. PHP supports virtually every DB under the sun (although Berkeley DB is missing, oddly enough.) Perl seems limited to MySQL and PostgreSQL, and its really a kludge for the later. I've heard that this will be fixed in upcoming versions of Perl though.
Since version 4 (over 10 years ago) Perl has had access to Sybase and Oracle. Newer additions (from the past 5 years or so) include MySQL, PostgreSQL, CSV flat-file DBs, DB2, *DBM, and an ODBC interface layer for just about any database.
The DBI module provides one uniform interface to all of these.
Speed. PHP is one of the fastest languages I've ever used. While it won't be replacing assembly or C, its definitely faster than Perl in most cases.
This depends wildly on what you're doing. PHP is pretty slow when it comes to handling deep, and complex data-structures, but quite fast when it comes to handling simple data like strings. Perl maintains a balance between these two, and an elegant interface to C and C++ for applications which need to speed up critical sections of code.
Portability. I can take PHP code off my Linux box and plop it onto an IIS server, or even one of those new Macintosh servers and have it run without having to change a single line of code. Try doing this with Perl! Its as though it was written in assembly, Perl requires that much rewriting.
My Perl programs run on Windows, MacOS/X, VMS, all UNIXen, and many other platforms. Dunno what you've had trouble with, but I suggest you may have had trouble with Perl because you were not familiar with it.
Graphics. PHP comes with a nice little graphics library. While I wouldn't use its to code the new Doom (VB would be a better choice!) its adequate for most web pages, and should be considered as a substitute for Flash for certain things. Perl lacks a graphics library of any kind.
This is so wildly untrue, it's amazing! Perl has some of the most comprehensive graphics handling possible. From OpenGL to the GD module to PDL, Perl can do anything from complex scientific simulation graphics to simple 2 and 3-D charts and graphs to line-drawing. PDL requires special note. It's a library for dealing with arbitrary binary data in a number of ways from performing vast arrays of numeric transformations (e.g. Fourier Transforms, and other matrix transformations) to rendering graphics to modifying image data. It's a god-send for the scientific community that previously had to deal with proprietary systems that were of dubious value given that they could not be modified.
There's even a comprehensive interface to The Gimp, which I wrote an article on for The Perl Journal.
The Perl resource that you probably are not aware of (based on your comments) is the Comprehensive Perl Archive Network (CPAN). There is a module list that gives you a nice index of everything that Perl can do that is not shipped with the binaries. Perl also provides a CPAN module that can be used to automatically download, compile and install anything from CPAN. -
Re:PHP resolves some shortcomings of Perl
I won't get into PHP-vs-Perl, as I think the two complement eachother nicely (if you realy know how to use mod_perl and PHP, you can do some amazing things with the Web which are not idealy suited to either one).
However, you are incorrect on some points:
Outstanding database support. PHP supports virtually every DB under the sun (although Berkeley DB is missing, oddly enough.) Perl seems limited to MySQL and PostgreSQL, and its really a kludge for the later. I've heard that this will be fixed in upcoming versions of Perl though.
Since version 4 (over 10 years ago) Perl has had access to Sybase and Oracle. Newer additions (from the past 5 years or so) include MySQL, PostgreSQL, CSV flat-file DBs, DB2, *DBM, and an ODBC interface layer for just about any database.
The DBI module provides one uniform interface to all of these.
Speed. PHP is one of the fastest languages I've ever used. While it won't be replacing assembly or C, its definitely faster than Perl in most cases.
This depends wildly on what you're doing. PHP is pretty slow when it comes to handling deep, and complex data-structures, but quite fast when it comes to handling simple data like strings. Perl maintains a balance between these two, and an elegant interface to C and C++ for applications which need to speed up critical sections of code.
Portability. I can take PHP code off my Linux box and plop it onto an IIS server, or even one of those new Macintosh servers and have it run without having to change a single line of code. Try doing this with Perl! Its as though it was written in assembly, Perl requires that much rewriting.
My Perl programs run on Windows, MacOS/X, VMS, all UNIXen, and many other platforms. Dunno what you've had trouble with, but I suggest you may have had trouble with Perl because you were not familiar with it.
Graphics. PHP comes with a nice little graphics library. While I wouldn't use its to code the new Doom (VB would be a better choice!) its adequate for most web pages, and should be considered as a substitute for Flash for certain things. Perl lacks a graphics library of any kind.
This is so wildly untrue, it's amazing! Perl has some of the most comprehensive graphics handling possible. From OpenGL to the GD module to PDL, Perl can do anything from complex scientific simulation graphics to simple 2 and 3-D charts and graphs to line-drawing. PDL requires special note. It's a library for dealing with arbitrary binary data in a number of ways from performing vast arrays of numeric transformations (e.g. Fourier Transforms, and other matrix transformations) to rendering graphics to modifying image data. It's a god-send for the scientific community that previously had to deal with proprietary systems that were of dubious value given that they could not be modified.
There's even a comprehensive interface to The Gimp, which I wrote an article on for The Perl Journal.
The Perl resource that you probably are not aware of (based on your comments) is the Comprehensive Perl Archive Network (CPAN). There is a module list that gives you a nice index of everything that Perl can do that is not shipped with the binaries. Perl also provides a CPAN module that can be used to automatically download, compile and install anything from CPAN. -
Re:Advantages of AppleScript over sh, awk, sed, etThe author of MacPerl once wrote a Perl OSA component. It was an essentially failed experiment, though I couldn't tell you all the reasons why. What I can say is that I don't think it's necessary for most purposes. MacPerl can speak Apple events, and now perl under Mac OS X can too, with Mac::Carbon. Soon Mac::Glue will also be ported to Mac OS X, allowing you to directly access "AppleScript" vocabulary from Perl, with stuff like:
#!/usr/bin/perl -w
That's hopefully coming to Mac OS X in January or Frburary, but don't hold me to it.
use Mac::Glue;
my $iTunes = new Mac::Glue 'iTunes';
my $tracks = $iTunes->obj( tracks => playlist => 'Blues' );
$iTunes->activate;
$iTunes->play( $tracks ); -
Re:Please listen up to my noteworthy advice
Haven't seen mention of this yet... HTML::Mason is one of a few embedded Perl solutions that operates very similar to PHP/ASP/JSP, etc.
To take your above example, rewritten in HTML::Mason would look like this:
% if ( something ) {
Something was selected
% } else {
Something was not selected
% }HTML::Mason also takes care of the variable collection. All arguments are put into %ARGS, in addition to putting them into declared variables:
<%args>
$id would be assigned 0 if the GET/POST didn't supply it, whereas $name would throw an error if it wasn't supplied.
$id => 0
$name
</%args>Also, general printing of variables is easy, too:
Hello, <% $name %>!
In general, a very decent system that addresses what you thought Perl couldn't do. Of course, this is just the tip of the iceberg for Mason. I won't even go into its inheritance model, it's default handlers, autohandlers, component model... that's worthy of an entire O'Reilly Book. =)
</perl-plug focus="HTML::Mason">
In the end, use the tool you're more comfortable with. If you like canned scripts (mail submit forms, BBSes, etc), PHP has a ton of them. If you want to code more of it yourself, Perl's CPAN is extensive. JSP for... uh, something, I'm sure. And if you're masochistic, there's ASP. ;P-Ducky
-
Re:Not only pi is interesting, also different sqrt
I don't know the URL of this website, however I know the program to generate this number. You can download it here and this is how you must run it:
perl -leprint\"3.\",0\ x\ number
Where number is the number of decimal places you want it to compute. I hope it helps.
-
Perl XQuery modules, where?
CPAN tells no XQuery Perl modules exist: No matches.
-
CGI::Application
Perl coders may also be interested in CGI::Application, for a similar MVC approach. I've done a few JSP apps which had a framework similar to Struts (too bad I didn't know about it beforehand), and now I hate to write perl CGI's in the unplanned, ad hoc way I used to do.
-
Re:The future of 3rd world countries is?
If you'd like to be more specific about which countries you filter, there's a perl module here. Available from all good CPAN mirrors.
-
Re:Another Great Idea...
Perhaps you should coax innovation in from the wild, PERL
-
Re:With a little help from AppleScript, I might adMac::AppleEvents / Mac::Glue allows it. Mac::AppleEvents is currently being ported to Mac OS X, but you can use it from MacPerl in Classic to talk to iTunes in Mac OS X in the meantime.
use Mac::Glue;
No AppleScript required or used, all raw Apple events, with the AppleScript *vocabulary* used (by parsing the aete resource to do the AppleScript->AE mapping, all done transparently and automatically, after simply dropping the target application on a droplet once). Hopefully, when it is ready for Mac OS X, it can be used as a more efficient and friendly alternative to AppleScript.
my $iTunes = new Mac::Glue 'iTunes';
# optionally talk to another host
# $iTunes->ADDRESS(eppc => 'iTunes', 'otherhost');
my %track;
my $name = $iTunes->prop(name => of => 'current track');
$track{name} = $iTunes->get($name);
$iTunes->pause;
Coming soon to Mac OS X box near you, as part of the already-released Mac::Carbon distribution. I am so gonna have fun with this when it is released ... -
Re:The Web and Free Software
In my experience, design reuse is often far more helpful and practical than actual reuse of code.
I definately agree. "Reuse Hysteria" should shift focus from code to design. Reusing human intelligence is more abstract, can be applied to nearly any development enviornment and deals with the problems that are usually much more difficult and costly than implementation. Broken pieces can always be fixed, broken designs are far more costly problems to deal with.
I am only saying the emphasis is in the wrong place because code reuse can definately help, I've used CPAN too many times to try an shortchange the benefits of code reuse. If only there was something as well put together and concise as CPAN for design reuse.
Unfortunately in CS programs "Design Reuse" is often seen as cheating, and any design reuse should come from personal experience.
Fortunately, open source software creates an excellent enviornment for promoting design reuse. -
Re:Perl was ruled out WHY???
Ever heard of Taint checking?
Also this "lack of sandboxing" displays an ignorance of, e.g. the Safe module.
This is not to detract from PHP's strides in various areas, but Perl has a few tricks up its sleeve and its performance whas at least comparable with PHP's.
-
Template ToolkitI don't use Mason. I use Template Tookit.
True separation of business and display logic.
Do all your processing, calculating, searching, formulating, control flow in perl with no HTML to be seen. Whack all your data in a hash. Pass said hash to Template->process(). Then any [% variable %] text in the HTML looks in the hash. Every web designer worth their salt can deal with that. What is great too is that [% %] comes as ordinary copy in Dreamweaver et alia. They can see where it's going to go. This has its limitations though. Some designers don't grasp the concept of dynamically generated hidden fields to pass variables in a session stack. They tend to omit important tracking stuff.
Also Templates [TT2 being the favourite] will generate your emails. Combined with the rather strenuous Text::Autoformat, you get freakin' nicely formatted text emails.
-
Re:Well Excel in Perl is pretty easy now
And, if you really enjoy a challenge, you can use Win32::OLE to actually open Excel/Word/Etc and pass commands to it, which allows you to do things like export the file to a CSV, save it as HTML, or whatever you want. It's a little cumbersome, but it saves you from actually having to use the products yourself!
-
Well Excel in Perl is pretty easy nowI've used the excel reading and writing modules for Perl with great success. They're easy to use and do the job. (there are also simpler interfaces if you want them too.)
Or you could go the whole hog and use a SAX writer like XML::SAXDriver::Excel to create the documents from XML yourself.
(This is not to say I don't think XML native formats arn't cool and will have many uses, I'm just pointing out what you can do now.)
-
Well Excel in Perl is pretty easy nowI've used the excel reading and writing modules for Perl with great success. They're easy to use and do the job. (there are also simpler interfaces if you want them too.)
Or you could go the whole hog and use a SAX writer like XML::SAXDriver::Excel to create the documents from XML yourself.
(This is not to say I don't think XML native formats arn't cool and will have many uses, I'm just pointing out what you can do now.)
-
Well Excel in Perl is pretty easy nowI've used the excel reading and writing modules for Perl with great success. They're easy to use and do the job. (there are also simpler interfaces if you want them too.)
Or you could go the whole hog and use a SAX writer like XML::SAXDriver::Excel to create the documents from XML yourself.
(This is not to say I don't think XML native formats arn't cool and will have many uses, I'm just pointing out what you can do now.)
-
Well Excel in Perl is pretty easy nowI've used the excel reading and writing modules for Perl with great success. They're easy to use and do the job. (there are also simpler interfaces if you want them too.)
Or you could go the whole hog and use a SAX writer like XML::SAXDriver::Excel to create the documents from XML yourself.
(This is not to say I don't think XML native formats arn't cool and will have many uses, I'm just pointing out what you can do now.)
-
Well Excel in Perl is pretty easy nowI've used the excel reading and writing modules for Perl with great success. They're easy to use and do the job. (there are also simpler interfaces if you want them too.)
Or you could go the whole hog and use a SAX writer like XML::SAXDriver::Excel to create the documents from XML yourself.
(This is not to say I don't think XML native formats arn't cool and will have many uses, I'm just pointing out what you can do now.)
-
Re:Perl is Perl, C is C
PERL doesn't have any extensions! It's only a guestbook and hit counter programming language.
-
XS Isn't the only way.
-
XS Isn't the only way.
-
Re:Linux errors are the best
I was compiling a program once (I sure as hell wish I remembered which program it was) and it told me that my refrigerator did not have enough beer.
I love to read Larry Wall's jokes and other comments hidden in the quickly flashing messages while I'm building perl. And I've only used the stable release, I suppose the development release has more of them. Get the perl source and check it out.
-
Perl
From the article:
"Gift a Washing Machine & get Pearl Set Free @ INR 8590"
They obviously don't know that Perl is FREE for most systems. -
"We will outsmart..."
We will outsmart OpenSource....
Read as:
We will outsmart, PHP, Perl, MySQL, OpenMosix, Apache, Audacity, Crystal Space, MiKTeX, SDL, Vega Strike, X-Tractor, FileZilla, ... (yes most of this also runs, if not exclusively, on windoze).
Or:
We will outsmart freedom and choice.
Somehow, I don't see it. Then again, a lot of money can buy a lot of laws.... -
Re:CPAN is 80 percent of PerlIt's all in there, and managable via the CPAN.pm module.
Don't forget about Jos Boumans' CPANPLUS. It rocks. Get it today. Yes, right now. That's a good slashtroll
;-P -
AIS server for the sun offering
-
AIS: an http[s] based SSI protocol
I wrote and published a web-based SSI protocol
at
http://www.pay2send.com/ais/AIS.html
Since I've draggegd my heels about patenting the
damn thing, there are no IP restrictions on it
Please feel free to implement AIS servers and
embed AIS clients in your web services.
I even wrote an AIS client module and uploaded it
to CPAN as CGI::AIS::Session.pm
view the embedded documentation
AIS is the "Let's do something better!" that some of you /.ers are calling for. Let's use it! -
Re:perhaps sorting the photos ahead of time
This was my thinking. ImageMagick is well suited for the job. There is even a Win32 TWAIN API for Perl. Combined with the Perl API for Imagemagick you could even write that custom application that will automate the whole process.
-
Re:this is a problem with cd distribution/automati
That's not a binary, it's source code
Here is a list of many win32 binary distributions of Perl, some of them with installers. I'm sure you can find one to suit your needs.