免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
楼主: mq110
打印 上一主题 下一主题

做为脚本语言来说perl和python那个更有优势? [复制链接]

论坛徽章:
13
15-16赛季CBA联赛之同曦
日期:2016-01-28 19:52:032015亚冠之北京国安
日期:2015-10-07 14:28:19NBA常规赛纪念章
日期:2015-05-04 22:32:03处女座
日期:2015-01-15 19:45:44卯兔
日期:2014-10-28 16:17:14白羊座
日期:2014-05-24 15:10:46寅虎
日期:2014-05-10 09:50:35白羊座
日期:2014-03-12 20:52:17午马
日期:2014-03-01 08:37:27射手座
日期:2014-02-19 19:26:54子鼠
日期:2013-11-30 09:03:56狮子座
日期:2013-09-08 08:37:52
1 [报告]
发表于 2012-07-18 16:01 |显示全部楼层
> Is it better to learn Perl or Python since i can manage only writing
> simple bash shell scripts.

It depends on more things, like the things you need to do, the language prefered by your team members, the platform you are targeting, etc.

If you need to do cli system administration, Perl is better.
If you need to do very many programs in many fields, Perl is better because there are very modules on CPAN that can help you.
If you need to do web programming, Perl is better if you consider to use the tools like Catalyst framework, DBIx::Class ORM, Template-Toolkit templating system, HTML::FormFu or HTML::FormHandler form processors and many other modules you can get from CPAN.

If you need to do programs that interact with the GUI of the OS, Python is better.
If you need support for Windows or for apps with a GUI, Python is better.
If you need to do programs to run on Symbian-based phones, Python is a choice while Perl is not (because symbianperl doesn't really exist).

If you work alone and you respect the best practices, Perl can be as clear as Python but if you work in a team, more and more new programmers consider to learn Python and not Perl, because Python code is clearer.
If you need to work in a team which has blind programmers, Perl is better because the punctuation chars that makes Perl code uglier makes the code more accessible than the Python code which needs a strict indentation.

If you want to use something trendy, Python is a much better choice these days.



perl sed & awk 的区别
bash   -   GNU   Bourne-Again   Shell
gawk   -   Pattern   Scanning   and   Processing   Language
sed   -   a   Stream   Editor   
perl   -   Practical   Extraction   and   Report   Language
perl : powerful like ksh, fast, use widely   
awk  : basic using in shell script,  also write awk script   
bash : provide user interface, also provide some command   
sed  : line editor, oriented  lines  
perl 是一种很强的编程语言,你几乎可以用它做任何事情,awk 则简单多了,主要用来处理具有一定格式的文件。如果是 shell 编程,awk、sed 等都是不可缺少的工具,当然 perl 完全可以替代 awk、sed、grep 等命令.

FROM: http://blog.chinaunix.net/uid-25256412-id-91255.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP