I have heard a lot about php but what can perl do that php can not

    With respect to web site programming, I can't think of anything off-hand I'd want to do with one that I couldn't do with the other. I personally find it easier and more convenient to use PHP for web site programming. On the other hand, as Perl was designed as a more general purpose language while PHP was designed from the ground up with web programming in mind, I usually find it easier to use Perl for non-web-related programming.

    If you google on something like "comparison of PHP and Perl", you'll find lots of pages. If you go to a page on a site that has the word "perl" in the domain name, it will probably tell you why Perl is much better; and if the domain name has "php" in it, guess what: it will probably tell you PHP is better. 🙂 Try reading some of each, and then form your own opinion based on what it is you want out of a programming language along with your personal tastes in programming style and technique.

      Perl can be useful for upload progress bars which PHP can't do

        Perl can be useful for upload progress bars which PHP can't do

        That makes absolutely no sense.

          ClarkF1 wrote:

          I stand corrected, but only if you have the PEAR package installed

          Or you want to write your own: I'm sure it could be done with a combination of JavaScript and PHP (a.k.a. "Ajax").

            I thought this was pretty TRICK when I find it reading the user comments on PHP.net under the function, flush() here: http://www.php.net/flush

            It was posted by a guy named Alex:

            
            <?php // Modified progress bar.. Works in IE, Mozilla+FF. ?>
            
            <html>
            <head>
            <style type="text/css"><!--
            
            div {
             margin: 1px;
             height: 20px;
             padding: 1px;
             border: 1px solid #000;
             width: 275px;
             background: #fff;
             color: #000;
             float: left;
             clear: right;
             top: 38px;
             z-index: 9
            }
            
            .percents {
             background: #FFF;
             border: 1px solid #CCC;
             margin: 1px;
             height: 20px;
             position:absolute;
             width:275px;
             z-index:10;
             left: 10px;
             top: 38px;
             text-align: center;
            }
            
            .blocks {
             background: #EEE;
             border: 1px solid #CCC;
             margin: 1px;
             height: 20px;
             width: 10px;
             position: absolute;
             z-index:11;
             left: 12px;
             top: 38px;
             filter: alpha(opacity=50);
             -moz-opacity: 0.5;
             opacity: 0.5;
             -khtml-opacity: .5
            }
            
            -->
            </style>
            </head>
            <body>
            
            <?php
            
            if (ob_get_level() == 0) {
               ob_start();
            }
            echo str_pad('Loading... ',4096)."<br />\n";
            for ($i = 0; $i < 25; $i++) {
               $d = $d + 11;
               $m=$d+10;
               //This div will show loading percents
               echo '<div class="percents">' . $i*4 . '%&nbsp;complete</div>';
               //This div will show progress bar
               echo '<div class="blocks" style="left: '.$d.'px">&nbsp;</div>';
               flush();
               ob_flush();
               sleep(1);
            }
            ob_end_flush();
            ?>
            <div class="percents" style="z-index:12">Done.</div>
            </body>
            </html>
            

              I stand corrected, but only if you have the PEAR package installed

              Why would Perl be better suited to such a problem? Perl and php are both server-side, hance both suffer the same sorts of problems with regard to client side interaction.

                perl is better at being more difficult to read. Also probably has faster string handling, particularly regexp.

                  thorpe wrote:

                  That makes absolutely no sense.

                  Well it does. You cant do upload progressbar entirely with PHP. You cant get the progress information from PHP until the upload is finished so its impossible to create a progressbar.

                  It has to be done using for example perl.

                    Shrike wrote:

                    perl is better at being more difficult to read. Also probably has faster string handling, particularly regexp.

                    Why would you WANT code to be hard to read?

                      Ascendancy wrote:

                      Why would you WANT code to be hard to read?

                      He's saying it's an ugly pile of arse to look at, and I can't agree more. Every time I have to write some perl I have to have a cry on the toilet for 15 minutes. Perl vs Php threads are many - and they get locked, somebody please do the same to this one.

                      Example #1 will lead to more.

                      http://phpbuilder.com/board/showthread.php?t=10306403

                        I do believe Weedpacket was correct in his post in the thread Drakla linked us to (thanks Drakla!); there has been plenty of "xxx vs. xxx" discussion on just about every topic under the sun (try counting the number of threads about "Which editor do you use to write code?" etc.).

                        Thus... I believe I'll follow Weedpacket's example and lock this thread. If you truly want to dive into this topic further than what's been discussed already, search the board or the web... I'm quite sure you'll find tons of information.

                          Write a Reply...