Khepri wrote:
>
> Investigating it a bit it seems that the major difference is perl
> scripts can be executable?
As you mentioned in another message, you meant this in comparison to PHP:
That's not exactly the case. As someone else already explained, any
file can be identified as "executable". I suspect what you mean is
"compiled as a binary". A very loose definition of the difference
between a "script" and a "program" might be that a script is a text file
that can be run by an interpreter and a program is a binary file that
runs on its own. Apparently, one can compile Perl, though I'm not sure
how that's accomplished, exactly. I write Perl scripts, set them
executable, and use them. There are also provisions for running Perl
"compile at runtime" or as normally interpreted, and there are
advantages to both approaches. I guess the long and the short of it is
that Perl can pretty much do anything -- remember that "Swiss Army
chainsaw" nickname for it.
Perl was originally written as a file handling language. It is so
powerful as a unix administration and web programming tool because of
the fact that its strengths lie in file manipulation, including
extremely rich regular expressions support. Keep in mind that, to unix,
everything is a file, including hardware.
PHP was written to interact with SQL and markup, basically. Its
functionality is more limited in scope. While there are those who think
Perl is haphazard in its structure, that's mostly because they've had a
haphazard introduction to it: Perl is more "comprehensive" than
"haphazard", in that it encompasses so much functionality that there's
basically no way to ever know all of Perl, or even most of it. PHP was,
in part, based on Perl, but it skipped a lot of approaches to getting
things done that Perl includes because it was designed for very specific
tasks. Because of that focus, it often seems to be "better" at
accomplishing those tasks, largely by making it more accessible and
providing a lot of core language functions that would otherwise probably
take several steps to complete. Unfortunately, this leaves PHP actually
having sort of a haphazard syntax where Perl does not.
I use both, as I said earlier. I use Perl for unix system
administration and some web programming. I use PHP for any web
scripting tasks that involve embedding programming logic in markup and
for interacting with a database -- it's just easier for me to use PHP
for those tasks than Perl. If you're looking for something to use for
unix system administration, I recommend Perl. If you're just looking
for web development tools, PHP may be more what you need.
Of course, if all you want to do is automate the sort of tasks you'd
typically be running at the CLI, you may just want to get a firm grasp
on shell scripting instead.
> An analogy from another arena is the martial arts people....OMG! They've
> got to be the worst!
I've got some opinions about that. . . .
> My philosophy on that one is similar to yours here...it's not the art,
> it's who can apply theirs better...:)
I wouldn't even say that's the case. I may be showing my aikido and
Perl roots here, but it's not about being better than anyone else. It's
just about getting the job done. As any Perl programmer worth his salt
might say, There's More Than One Way To Do It.
-- Chad
This archive was generated by hypermail 2.1.3 : Fri Aug 01 2014 - 20:40:50 EDT