|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Article Discussion: An Alternative to Perl: Shell Scripting With PHP
An Alternative to Perl: Shell Scripting With PHP If you have any questions or comments about this article then please post them here.
You can read the article here . |
|
#2
|
|||
|
|||
|
Bad Interpreter
Hi!
Well I have made the following script test.php: !#/usr/bin/php <?php echo "Hello World"; ?> then chmod +x test.php when I run it like this ./test.php it tells me bad interpreter . I am running Redhat 7.2 with php PHP Version 4.1.2 Thank You! Best Regards, Dhaval Desai |
|
#3
|
|||
|
|||
|
Nice article, but PERL could never be replaced by PHP, not even in the next 10 versions........
![]()
__________________
~ Joe Penn We work for free to help make this a valuable resource on the internet. Do you appreciate the help - did we provide help that will help you prosper and help that has contributed to sharpening your current skill set? Show your appreciation and purchase something from our Amazon Wishlist's - it's simple and a great way to say thank you. |
|
#4
|
|||
|
|||
|
Related to the above posting > Prove it!
|
|
#5
|
|||
|
|||
|
Um - two words - Client Side..
Need more? ![]() |
|
#6
|
|||
|
|||
|
Hehehe... Good Argument!
Now we need a rebutal... Just not sure it can be beaten!
__________________
____________________________________________ Developer Shed Weekly Writer | DevArticles Forum Moderator Build Your Own KlipFolio Klip With PHP FrankManno.com - Under Construction Design Interactive Group - Under Construction |
|
#7
|
|||
|
|||
|
Partially I agree with you, but then if we are talking about client side programming, there is Java. Perl can't match Java on client side programming at all. The fact is that, Perl, Java and Visual Basics suck - period. Those languages are just there for newbies. The real programming is done in C++ or C. For websites I still perfer PHP above all languages and may be just may be Java Script partially. PHP is easy for one thing. On the other hand PHP is very powerfull (Just look at the extension available. Perl has this many extensions?). Lately PHP has been improved. PHP now is officially supporting CLI. Now you could do twice as much with PHP as you could before. There is also PHP-GTK. That alone is a whole new story. Above all PHP is open source and it works with the worlds best web server - Apache. What else do you want really? Patches are reased asap, updates come reqularly, plenty of support and resources (including this lovely forum) and on top of all that PHP is compatible with most OS and it isn't microsoft programming. I think we should be sending PHP's programmers and organizers a thank you letter twice a day. And while you are busy typing, write two more letters to microsoft telling them how much you love their open source applications, which they have non of (almost)!
|
|
#8
|
|||
|
|||
|
Quote:
I'd like you to show me the newbies that are able to handle all aspects of OOP (refactoring, polymorphism, inheritance, etc)... (in case you don't know, Java is based on OOP programming) ![]()
__________________
Best Regards, Håvard Lindset |
|
#9
|
|||||||
|
|||||||
|
Quote:
Well, you have two of the BIG three in the list there. We can safely move Visual Basics out of the power list, because it does not compare to the other two you have listed. The one missing in the BIG three list is C. Now, honestly - no language sucks, they all serve thier purpose and serve thier purpose well. There are some that serve thier purpose better than others, but in the end, all languages are good for what they have been designed to do. This excludes Cold Fusion from the list because cold fusion is weak from the ground up and made for users who absolutley have no clue of application programming concept - but again, it serves its purpose well. I have a feeling that you have not alot of background in the industry as of yet as I have never seen no one say that PERL sucks -> never even heard it come out of VB/ASP developers. One thing to remember is that if there was no PERL, there would not be no PHP; as PHP was originally derived from PERL. Quote:
Ok - out of the three you have listed, Visual Basics fits that description. PERL and Java are far (and when I say far, I mean around the globe far) away from newbie languages. When PHP3 was out, it was the most newbie'ish (not sure if that is a word) language on the market. Since PHP4, VB and CF is fighting hard for that title. It took me a whole whopping 4 weeks to learn PHP (maybe not even that long) when I first started to develop with it a long while ago - how -> it was because of the years I had under my belt as a PERL developer. Switching from PERL to PHP for web projects was absolutley the most simplistic thing I have ever done in my life. I guarantee you that I can go out and find a senior PERL developer somewhere that has never dabbled with PHP and pay him/her and within 2 months or less be able to develop quality fool proof e-commerce applications; it would take no less than 6 to 8 months for an equivalent application written in PERL by a PHP developer. Quote:
Have you ever been fishing? You catch that fish and drop him in the cooler. The fish is then jumping/flapping around and gasping for air. That is how that project is right now - not to mention a little bit buggy at the moment. Its a good effort by the GTK team, but still falls short in a number of ways. Quote:
Well, so is PERL and so does PERL; respectively. Quote:
Actually, I do to some extent. Our Corporation supports open source and is making strives to break into the high end corporate market and the Federal Government (btw - which is the largest purchaser of software products on the entire planet). Our strives are much more than a thank you letter... ![]() |
|
#10
|
|||
|
|||
|
No offense Lindset, but these days High School learn that stuff.. I won't be surprized if it is even earlier! Now Java is the office Hight School language. Are you aware of that?
I'am perfectly aware of Java's OOP... how can't I be? It only takes two hours (with a lot of exaggeration...) to compile a program! You know what I mean. Forget about large projects. And no, I'm not running it on a 486 but on a P3 1G, 1G ram. I can't imagine how slow it would be on 486 machine.. may not even run at all. Look at the size of the JDK.. my goodness it doesn't even fit on any old HDD! Don't give me wrong, Java is powerfull but inefficient. If java complies anywhere close to the speed of C++ I would probably use Java for most appications. I think Sun has just put together too much. Even prof's in MIT don't know more then 1/4 of Java's API's. To jpenn: Please, I don't rob any one of their experience with a programming language. I know very well that programming is not about the languange but the reasoning, the logic and the approach taken by the programmer. The language is only a tool that develops those skills. Anyone who knows a language well, like yourseft, could transfer to any high level language pretty easy. Think about it, Java and C++ are pretty close in syntax. PHP is hybrid of both! Now how hard it is to learn Java or PHP if you are a professional C++ programmer? Perl, is also close the all those languages. Yes, no argument that Perl is the pioneer of all scripting languages. But just to end this discussion, can you give me an example of something PHP can't do that Perl could (exclude client scripting/programming)? Also I will have to partially disagree with you about PHP-GTK. Yes, it is in it's development years, but yet it is still faster than Java. PHP-GTK is used very little mainly because most programmers don't know GTK. I'm assuming 7/10 PHP programmers don't know about PHP-GTK. I would give it couple of more years before it challenges Java. I base my calcutions on fact that PHP has been arround only for while and look how far has come! 60% of websites have reported using PHP. Perl has been arround far longer than PHP and they are nearly at equal levels. You to give PHP a lot of credit here! You would have to agree that Perl is still being wide used because most people know it well, every well, they are Perl guru's and they don't want to learn anything new. There are so many Perl based applications, that I would take alone two years to rewrite them in PHP. So in way Perl is force upon many programmers, either because they are experts with the language or bacuase they are maintaining Perl based appications. It is like Cobol for Banking! 'No choice... it works so we will use it'. I hope at least they have gotten rid of the bugs in Cobol ![]() Also I do take back the word 'suck' from my previous post (I was again over using the word) since I completely agree that each language has it strenghts and weaknesses; there isn't any strong argement I could compile to proove otherwise. |
|
#11
|
|||
|
|||
|
Quote:
Prove it? I don't know why someone would want to write more code for trivial stuff, here are your examples in perl: example1: print "Hello World"; example2: print "Enter your name: "; print "Your name is :", <STDIN>; example3: warn "There was an error."; example4: print map { "Argument " . $i++ . ": $_\n" } @ARGV; |
|
#12
|
|||
|
|||
|
Quote:
You obviously have no idea what you're talking about. Java is almost identical to C++ in syntax and use save for the fact that classes are mandatory (which actually makes Java easier for OOP in most cases). It's just as complex, and the new version of Java even uses C++ features such as templates. Java has always been viewed as the closest language to C++ (arguable when it comes to C... but given the tendencies towards OOP in Java and the fact that C really only mocks OOP with structs I'd still say that Java is closer). Also, PERL is not a programming language. It's the Practical Extraction and Reports language... a scripting language. Much different, and useful in an entirely different situation (it's extremely useful under Linux, second to shell script). Also, Visual Basic is not a programming language. It's not even a scripting language. It's a front-end to a language the "programmer" never even sees -- much like Macromedia's Coldfusion. It's only practical use is in web scripting and it's far outdone by javascript for most, if not all, uses. |
|
#13
|
|||
|
|||
|
Quote:
While you're probably correct in saying that PHP is easier to learn than PERL, I think it would be incorrect to say that PHP is any less powerful than PERL for it. I have come across several situations where PHP has increased my productivity because of a syntax that results in fewer lines of code to do the same thing (with no loss of flexibility or power). Last edited by Akujin : November 29th, 2005 at 09:24 PM. Reason: misunderstood wording, small correction. |
![]() |
| Viewing: Dev Articles Community Forums > Programming > Programming Tools > Article Discussion: An Alternative to Perl: Shell Scripting With PHP |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|