开发者

Perl vs. PHP to tar files on a remote server then move them to another remote server

I need to create a web application that tars files on a remote server then moves those files to another server. I am new to scripting languages and was wondering if there are advanta开发者_如何转开发ges to php or perl for this type of application.


Not really. Both will get the job done just as good as the other. The bottleneck of both will be connecting to the remote server.


PHP was originally derived from Perl, so the syntax between the two are very similar. It's all a matter of taste.

PHP is nice because many Apache servers are setup to allow you to embed PHP code inside your HTML pages. This makes PHP very popular in building things like CMS systems and bulletin boards.

I personally think that the PHP syntax is sloppy. There's way too many specific functions and they're not clearly thought out. The syntax changes from one function to another. I guess it's part of PHP's group based philosophy where a lot of people add a lot of features. I also like Perl's use strict and use warnings pragmas which I find save me a lot of grief.

But, as I said, when it comes to webpage development, PHP is ahead of Perl.

(Yes, I know about modperl, but that's not usually installed in most Apache servers).

I'd say to go ahead and learn both. I believe the Perl books are some of the best written programming guides I've seen. I haven't been too thrilled with the PHP ones. Maybe its because Perl is just more established, so the documentation has been better defined.

Then again, if you're going to learn something, maybe you should try Python. I'm not a fan of Python, but its the up and coming language that most people are learning these days. Google uses Python extensively. And, don't forget Ruby which has the webbased Rails platform that's very popular.

By the way, what you want to do isn't part of the default language, but most languages have modules that are easily installable. For example, you'll need Archive::Tar and LWP for Perl. These can be downloaded from the CPAN module archive.

It's going to take you a while to pick up enough of any language to do what you want, so be patient and have fun.


You need this ssh extension http://php.net/manual/en/book.ssh2.php

It support calling ssh using ssh2_connect.
And you can bundle with tar, scp, or even rsync

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜