由买买提看人间百态

topics

全部话题 - 话题: perl
首页 上页 1 2 3 4 5 6 7 8 9 10 下页 末页 (共10页)
i*****f
发帖数: 578
1
来自主题: Programming版 - Do you like perl style?
I don't like perl very much.
First, the codes are almost 'write-only'
Second, I dont like the philosophy of "there's more than one way to do it".
And I heard that the next version of Perl will be quite different to the
current one(???)
Also, somebody(Python users) think that the OO-support of Perl is not
natural.
I like Tcl, the syntax of which is extremely simple (everything is string)
and elegent (every statement is a command)
Discussions are welcomed:)))
f*********e
发帖数: 8453
2
来自主题: Programming版 - 问个perl Mechanize问题
【 以下文字转载自 BuildingWeb 讨论区 】
发信人: furthermore (找啊找啊找), 信区: BuildingWeb
标 题: 问个perl Mechanize问题
发信站: BBS 未名空间站 (Sat Jun 14 09:57:44 2008), 转信
正自学,在学自动访问网页部分WWW::Mechanize。
可是写了几句小程序却总出错:
#! /usr/bin/perl -w
use strict;
use constant URL => "http://localhost:8081";
use WWW::Mechanize;
my $browser = WWW::Mechanize->new();
$browser->get(URL);
if($browser->success) {
my $content = $browser->content;
print "Result: '$content'\n";
}
else {
print "failed";
}
我用的perl环境是从activeperl下
j******y
发帖数: 700
3
来自主题: Programming版 - perl non web framework
不太明白楼主要的什么?
你是想在自己的机器上运行perl的script? 直接Perl就好了阿,PC上面active-state-
perl
h**o
发帖数: 548
4
文件 a.txt 内容是这样的:格式比较固定:
abcd1234http://yahoo.com/>mitbbsmitbbs
需要得到结果 http://yahoo.com
我想用这个perl命令但不对:
perl -pe 's/\/$1/' a.txt
请问错在哪儿?应该怎么写?
不好意思刚开始学perl.
F*******n
发帖数: 89
5
来自主题: Programming版 - PERL新手请高手推荐perl的IDE
请问perl有什么流行的IDE?大侠们请推荐啊。
不知道perl的IDE能不能像 netbeans那样可以自动提示的功能?
谢谢。
I*******e
发帖数: 1879
6
☆─────────────────────────────────────☆
nkw (非死非活) 于 (Fri Feb 20 23:16:30 2009) 提到:
perl实在太慢了。能转成python都快几倍。
比如,下面这两个程序 python 比 perl 快两倍多。
#! /usr/bin/perl
$n = 50000;
$x = 0.2;
$mu = 10;
$pu = 0;
@pol = ();
for ($i = 0; $i < $n; $i++) {
for ($j = 0; $j < 100; $j++) {
$mu = ($mu + 2) / 2;
$pol[$j] = $mu;
}
$s = 0;
for ($j = 0; $j < 100; $j++) {
$s = $x * $s + $pol[$j];
}
$pu += $s;
}
print "$pu\n";
Python
n = 500000
x = 0.2
def t(x):
.mu = 10.0
.pu = 0.0
.pol =[0] * 100
.r = range(0,100)
.
c********g
发帖数: 4
7
来自主题: Programming版 - perl 一问
小弟是perl菜鸟,前来问个embperl (.epl)的问题
公司原来软件的界面是embperl 写的,可以运行
我被要求修改这个界面。我把软件下载到本人账号下的public_html文件夹下 (这个
文件夹是专门为浏览器访问的,比如说我的个人主页)
public_html文件夹据说只能让.pl .cgi .html文件工作。
我的.epl文件不work, 我的问题是怎么能让 .epl文件在public_html 文件夹下work.
我试过把.epl改为.pl, 不行
//.epl 能用perl直接编译吗,还是要重新写perl code?
问题有点乱,望大虾赐教,多谢了
B******5
发帖数: 4676
8
来自主题: Programming版 - 新人,问个很弱的perl问题
刚学perl,用system函数调用自己写的程序,在linux下面用了&后缀,所以后台运行,
然后想让perl继续编辑自己程序的输出文件,怎样在perl里面知道我的程序运行结束了
呢?
请达人指教,谢谢
v*****r
发帖数: 2325
9
yes, perl's regular expression function is fantasitc.
if your purpose is just to finish data analysis/process task at hand, perl
is the # pick.
but if your use perl all the time, you becomes less of a programmer...
as a computing problem solver, you can either use other people's stuff vs
invent your own wheel.
but if you stay true to computer science, i think we still need to invent
our wheel at some %.
actually a lot of companies, they write their own OS, or certain module,
even you can find
l******e
发帖数: 12192
10
本来就谈不上hate
就是说稍稍大一点点的项目上perl就不合适了,楼主基本也是这个意思
至于说laziness/lack of discipline本来就他自谦的话吧;话说回来,为啥有点lazin
ess就不用perl用python呢。

when
Perl
j***k
发帖数: 2719
11
I don;t know a thing about c++ but i have done a great deal of both Perl,
Java, and C#. They all have their own sets of advantages. For example, Java
has an amzing lib of concurrency classes. Neither Perl nor C# is anywhere
close. Perl is amazingly fast with text parsing. C#'s LINQ is just
convenient. So, it would be really up to the task to choose the right
language. I have no preference.
r********3
发帖数: 2998
12
你对perl掌握得很好。
但是大部分掌握一般的情况,连自己写的perl都无法读懂,怎么调试?(关于perl可读
性差,你就不要跟我争了)

,P
v*****r
发帖数: 2325
13
tried using Java to do some control group analysis projects (used to be done
in perl),
很明显的体会是JAVA 强迫您FOLLOW OOB, 写着写着, 我已经做了好几次REFACTORING
。。。 我不确定PERL 也可以做REFACTORING。。。还有常用的APPLICATION我可以写成
ANALYSIS TOOL给其他人用, 如果有类似的ACTION ITEM, 我可以让他们用TOOL, 而
不是我每次来做 一样的ANALYSIS
thumb up to java, down to perl!
a****l
发帖数: 8211
14
我现在有一堆的C程序,需要知道其中宏定义的数值.比如:
file1: #define pig 1
file2: #define sheep 2
file3: #define dog 5
file4: #define total dog+sheep-pig
需要用一个比如perl的脚本程序扫描过所有的文件,然后能输出total=6.问题是显然这
个计算的方法不是固定的,所以脚本程序基本上需要按照C的规定展开宏定义,找到各词
语对应的数值,再计算出最终的数字.
有谁知道perl能不能做这样的工作?如果不是perl,有什么东西能做这样的事?谢谢!
f**********w
发帖数: 93
15
来自主题: Programming版 - 问个在C++中调用perl的问题
公司的cgi程序是用C++写的,根据请求的种类,调用相应的已写好的perl程序做字符处
理(embed perl)。然后把处理好的数据写到数据库。每天有几百万次请求。 我的问
题是:
1) 这样做比直接用C++做全部处理要慢多少?
2) 在不用C++重写perl的情况下,有什么速度优化的选择?
谢谢
t****t
发帖数: 6806
16
来自主题: Programming版 - PERL问题
@a=map { $_*($_+1) } (1..5);
but this is not generic component-wise calculation.
you may, though, write
@c = map { $a[$_] * $b[$_] } (0..4);
but this is dumb.
BTW, if you write in perl, think in perl. don't think in matlab and write
perl. you can translate literally, but you will result in dumb code.
v*****r
发帖数: 1119
17
来自主题: Programming版 - perl怎么这么难?
不是你的问题,是写 code 的人的问题,perl 的 TIMTOWTDI motto 导致这个问题很
严重,两个 top perl coders 可以是完全不同的 style, this is the side effect
of perl's power.
l******g
发帖数: 31
18
I need a webcrawler written in perl to download google trend data. I would
image this is something easy for computer sciense guy to do. google trend
requires the user to login with his/her google account, then a button to
download the data into CSV format will show up. I need a perl program to do
it automatically as I have lots of tickers to go through. here is an example
of google trend for Intel.
http://www.google.com/trends/?q=intc&ctab=0&geo=us&geor=all&dat
If anybody is willing to write me ... 阅读全帖
b****n
发帖数: 464
19
来自主题: Programming版 - 请教perl的tainted和cgi::param()
我现在的工作需要维护一个网站。在执行perl的时候,为了安全的原因,用了 perl -T
(tainted)。然后接下来有一步需要用 param(“xxx”) 获得变量值。这个一般都没有
任何问题。
只有一个罕见的情况。当用户在表格里填入单独一个加号 “+” 的时候,到param()
这步会出问题
Insecure dependency in require while running with -T switch at /global/xxx..
..xxxx/CGI.pm line 533.
BEGIN failed--compilation aborted.
这个问题目前只发现在单独一个加号上。换作其他符号,或者正常的词,或者是加号前
面或后面有空白,都不会出问题。
看起来这个问题是perl内部的。但是有没有什么好办法可以work around呢?
谢谢!
c*********e
发帖数: 16335
20
来自主题: Programming版 - Is Javascript the new PERL?
别侮辱perl. perl语言的简洁,类似unix/linux的查找,还是非常牛的。可惜曲高和寡
,太难学,最终php用来做网页。perl处理文本一流。
w*s
发帖数: 7227
21
【 以下文字转载自 Linux 讨论区 】
发信人: wds (净洗前尘,从头再来), 信区: Linux
标 题: how to avoid security holes for perl CGI code using checkbox ?
发信站: BBS 未名空间站 (Thu Apr 18 19:01:05 2013, 美东)
Don't know how to describe this clearly,
i have a simple perl CGI code, running with lighttpd.
it has checkbox, if it's set, when you click "submit".
it will trigger my code in the background,
`set_my_value.exe 1`.
if no check that checkbox,
`set_my_value.exe 0`.
Now when i run Rapid7 nexpose, which is a security check applicatio... 阅读全帖
F****3
发帖数: 1504
22
谢谢楼上给我的建议!!!
菜鸟弱问一下三个相关的问题:
1) Python的re package是不是没有perl的regular expression那么强大?
2) 或者说Python处理文本没有perl那么多"现成的东西多"?我是菜鸟,很多时候一般
要看看cpan之类上面的别人的code才能入门。。。
3) 我的工作百分之99%是处理文本,请问这种情况是不是还是学一下perl比较好一点。谢
谢!
k*******3
发帖数: 1909
23
来自主题: Programming版 - perl oneliner hash疑问
有个问题debug很久没有结果,问题简化如下:
有一个test.pl文件,内容如下
#!/usr/bin/perl
use strict;
use warnings;
my %metrics = ();
$metrics{"Average"} = "SomeValue";
`perl -e 'if(exists \$metrics{\ "Average\ "}){print \ "found\ ";}' > out.txt
`;
运行这个文件perl test.pl, 会产生out.txt,但是为什么out.txt内容是空的,我期待
out.txt的内容是found。百思不得其解,请大牛指教。谢谢!
我在\和"之间故意加了空格,否则网页无法显示\.
s*******h
发帖数: 3219
24
【 以下文字转载自 JobHunting 讨论区 】
发信人: sammamish (sammamish), 信区: JobHunting
标 题: 有一天python会不会像perl一样悄悄的消亡了
发信站: BBS 未名空间站 (Sat Aug 24 17:08:31 2013, 美东)
perl这几年突然就没人用了,转年就死了。python和perl也没多大差别。会不会?
e*******o
发帖数: 4654
25
Perl 程序员老鸟多,像我这种拉后腿的少。Perl的职位比Perl程序员多,要是我学的
python或者java,现在估计还在老老实实的杀小白鼠。
d****i
发帖数: 4809
26
来自主题: Programming版 - Perl 大牛是学啥专业的。 (转载)
Perl发明的初衷就是为了代替Unix下各种shell script:Bourn shell, bash, C shell
, Korn shell, tcsh, zsh, awk, sed等等一堆, 结果几十年了,shell script还是没
被Perl代替,在Unix下用的不比Perl少甚至更多。
o******1
发帖数: 1046
27
多谢上面的大牛们的指点!费了一个晚上终于找出来毛病了。但是我还有个问题,大牛
们请继续帮忙。
1. 我的那个c的可执行文件是从oracle数据库里面retrieve东西,然后打印到stdout。
2. 我的问题其实不是C可执行文件的stdout没有返回到perl,而是C没有从数据库里面
retrieve到东西。所以先纠正一下之前我的错误,不管是用backticks,还是open
filehandle "C-proc |",都是返回了的。
3. 我是这样fix了原先的问题的:在perl文件中,加入了两行环境变量的设置,i.e. $
ENV{'LD_LIBRARY_PATH'} = '...'; 和$ENV{'ORACLE_HOME'} = '...'; 之后就没问题
了。
4. 那个C可执行文件在command line直接运行是没有问题的,也就是说
shell知道环境变量$LD_LIBRARY_PATH和$ORACLE_HOME的值。但是在perl文件的
backticks中执行,这两个环境变量是空白的。
5. 我的新问题是:在编程语言中,有没有一个简单的方法,一次性的把所有的shel... 阅读全帖
e*******o
发帖数: 4654
28
建议你把programming perl 买来,Perl 的经典参考书。Perl 辉煌不在,amazon 上
3rd 的加邮费才4块钱。
f****8
发帖数: 2
29
来自主题: Programming版 - Is Perl programming Language still viable?
我在这里已经潜水了一段时间, 获益良多!看这里从来没有看到人提过 Perl。 还
有人 / 公司用 Perl 吗? 如果有, 哪些公司、行业还在用?在生物技术公司,
大中型制药公司, 还有用 Perl 的吗? 谢谢!
e*******o
发帖数: 4654
30
来自主题: Programming版 - perl sprintf question converting dec to hex
1.
➜ perl -MDevel::Peek -E 'Dump(-1)'
SV = IV(0x15f02a0) at 0x15f02b0
REFCNT = 1
FLAGS = (PADTMP,IOK,READONLY,pIOK)
IV = -1
this show -1 is stored as IV internally.
➜ perl -V:ivsize
ivsize='8';
the unit is bytes, so size in bit
ivszie * 8 = 64 .
2. same with C, 1$
http://perldoc.perl.org/functions/sprintf.html
w***g
发帖数: 5958
31
来自主题: Programming版 - Perl程序员工作机会多吗?
纯perl的可能不多。不过我见过做系统的大牛用perl处理数据的。
整个研发team就是C + perl那种。
e*******o
发帖数: 4654
32
来自主题: Programming版 - mitbbs.com还用perl?
cgi 不是只有Perl吧
只是很可能是Perl
ps 我天天写Perl 能赚钱就好
e***i
发帖数: 231
33
大牛多是老一辈,是C和Perl的年代
Perl 3, released in 1989
Perl 5 - 1994
Python 2.0 是2000年
PHP4也是2000年
Ruby on Rails 是2005年
应该听听新牛的说法
s****l
发帖数: 78
34
learning perl -> programming perl -> advanced perl programming
j*c
发帖数: 97
35
来自主题: Unix版 - System Environment variables in Perl
I don't know if this is a properiate board to post this question, but here it
is:
In perl, one can always read the system environment variable from pre-defined
hash %ENV. If one runs a perl script from a shell, it will inherit all the
environment variables available in the shell, including the system variables
like ARCH, USER, HOSTNAME etc. However, my problem is that if I submit a
job(in perl) to a job manager(Condor as we use), I can't get these variables
in %ENV. I suspect that Condor use a s
g***y
发帖数: 27
36
来自主题: Unix版 - perl , ssi 问题
有没有什么命令能知道学校给提供的放个人网页的空间是否支持perl server scripts?
情况是这样:学校的os是sun的unix,而且可以编译运行perl程序。但是我在shtml里用
, browser里就显示[an error occurred while
processing this directive]
如果我用, browser里就会把这个perl
文件的源码整个显示出来.
这是不是说明不能用server scripts?
c**t
发帖数: 2744
37
来自主题: Unix版 - perl , ssi 问题
How about using ?

有没有什么命令能知道学校给提供的放个人网页的空间是否支持perl server scripts?
情况是这样:学校的os是sun的unix,而且可以编译运行perl程序。但是我在shtml里用
, browser里就显示[an error occurred while
processing this directive]
如果我用, browser里就会把这个perl
文件的源码整个显示出来.
这是不是说明不能用server scripts?
b*m
发帖数: 5
38
来自主题: Unix版 - Perl和Python哪个更好呀?

------------------------ This is WRONG. perl ( and mod_perl) is
very much faster than java(jsp). Perl is much safer than Java.
Perl(mod_perl) have been here for almost decade, how many times have you ever
heard someone is able to crack it?
两者是
x*********g
发帖数: 11508
39
来自主题: Unix版 - Perl和Python哪个更好呀?
你这不是仍然在拿senior perl/python programmer和entry level java programmer比吗


唉,看贴子要在字里行间看出省略掉的形容词。就好比前面有人说Amazon用perl,google
,不
反驳
experience
哈哈,看来老兄是Perl的坚定支持者。我只是说各有用处,您老兄就开始攻击python和Ja
c****n
发帖数: 89
40
来自主题: Unix版 - how to uninstll perl?
You dont have to know the installer, try the first one, if
it doesnt work, try the second, it deletes perl directory
by "rm -rf ..."..
"locate perl" to find where they put "perl".
But if you done have root authority, no way to delete it, i guess.
w*****s
发帖数: 122
41
来自主题: XML版 - Perl XML FAQ--1
Perl XML FAQ
Version 1.1
by Jonathan Eisenzopf Credits
Thanks to Clark Cooper, Matthew Sergeant, Enno Derksen, Ken MacLeod, Rob
Cameron, and Asakura Hiroshi for their contributions to this FAQ.
Overview
This FAQ contains information related to using and manipulating XML with
Perl. Please direct all corrections and additions to e***[email protected]. This
FAQ can be found on the Web at http://www.perlxml.com/faq/perl-xml-faq.html.
Asakura Hiroshi has created a Japanese translati
c****r
发帖数: 576
42
同意,Perl/Python方便好用是相对编译性的语言如C/C++/Java等而言;如果平时就用脚本语言如R,那就无所谓了,除非特别依赖于某些别人做好的软件包,比如BioPerl之类。
R script和Perl的语法一样丑陋。同样用C语言写的平台,Matlab的语法就很简洁清晰。主流貌似C/C++ 结合Perl/Python?我用C + Matlab,后者用来读什么数据库或解析文本,甚至建数据库都没问题(当然数值模拟之类比其他语言“方便”很多,其实用的也是Fortran的软件包),牛人还用excel编游戏呢。语言本身不是重点,了解各种语言的优缺点以及掌握编程技巧/算法才是关键,太多例子 -- 用效率高的语言也能写出来效率低的程序,反之亦然。忌讳的就是什么都会一点但什么都不深入。某日一学生兴高采烈的说Python有split函数很方便,却不知她天天用的Matlab也有textscan可以实现同样功能。

势就体现出来了。
10分钟去编个C,之后30秒跑完呢?

发帖数: 1
43
来自主题: Biology版 - 生物信息 选python or perl
看到过用perl的,也看到过用phthon的。个人没用过python, perl处理字符串和大数据
还是比较给力的,其中的hash用到的比较多。
如果学习perl, 有一本封面是小羊驼的入门书。

or
r*****q
发帖数: 216
44
请教一个在CGI 中使用自己改写的Model时的问题 Mastering Perl for
Bioinformatics中的例子
先说一下我的调试环境 IIS5.1 XP ActivePerl 5.8.8
自己改写了3个Model 1.Restrictionmap.pm 2. Rebase.pm 3. SeqFileIO.pm (这三个
package 我的已经分别在cmd模式下调试过了,都没有问题,而且我都放在IIS5.1的默认
的/Inetpub/wwwroot/的文件夹中了 ;在最后面另附model 的用法说明)
然后用main.cgi 实现 (以用 perl -c main.cgi 编译过 syntax ok)
在调试的时候 我自己加了三个标志
1>print "$sequence\n", "one",hr;
2>print "two",hr;
3>print "three",hr;
但在调试时 只能显示第一个标志,第二三个都没有显示(自己怀疑是标志1之后的语句
有问题,但用想不明白,请帮忙看看)
另外 还有一个问题 main.cgi可以upload文件 但在选取文件之后
c*********u
发帖数: 361
45
来自主题: Quant版 - 学python 还是perl 还是lua ?
Perl was orignally designed for string manipulations, it has dynamic typing,
built-in regular expression etc. Then it evolves to a powerful scripting la
nguage and gained vast popularity through the advent of Internet. A lot of I
T companies (and IT in banks I suppose) use Perl extensively, e.g. Amazon.
Python has cleaner OO support (compared to Perl) and is more natural to use,
Google seems to like Python.
Don't know about Lua.
z**k
发帖数: 378
46
上手难度基本为0,那本O'Reilly的learning Perl看完就好了,也才一两百页,电子版
很好找
两天一定搞定。只要不做hard science,其他的东西用到再看也不迟
我还是推荐Perl了,你说要处理数据,Perl绝对是王道啊。而且楼上说Python比较容易我倒是不以为
然,我认识的人里面都是Python和C/C++一起用的,所以要学的东西其实更多些。
l******t
发帖数: 2243
47
来自主题: Statistics版 - PERL code to view SAS log in color in UNIX
thanks

发信人: DaShagen (Unbearable lightness), 信区: Statistics
标 题: PERL code to view SAS log in color in UNIX
发信站: BBS 未名空间站 (Sat Jan 22 13:26:18 2011, 美东)
If you don't have perl installed, this won't help you.
#!/usr/bin/perl -w
$0=~/.*\/(.*)/;
use Term::ANSIColor;
die "\nUsage: $1 \n\n" if @ARGV!=1;
my @content = `cat $ARGV[0]`;
for (@content)
{
if ($_=~/NOTE:/)
{ print color 'bold blue';}
elsif ($_=~/WARNING:/)
{ print color 'bold ye... 阅读全帖
t**********s
发帖数: 13
48
来自主题: Statistics版 - perl error求助
本人非计算机背景,装了一个软件运行,显示如下错误,请牛人看看怎么解决
Bareword "Internals::inc_sub_generation" not allowed while "strict subs"
in use at C:/Perl/lib/constant.pm line 112.
Compilation failed in require at C:/Perl/lib/Getopt/Long.pm line 226.
BEGIN failed--compilation aborted at C:/Perl/lib/Getopt/Long.pm line 226.
谢谢!
b*******e
发帖数: 287
49
来自主题: JobHunting版 - Salary 100K+ Perl Software Developer
xxx,
I came across your resume and wanted to touch base with you.
I have a client in Houston looking for a Software Developer with strong PERL
experience.
The manager is willing to pay relocation in order to get the right talent in
the door.
· Full-time
· Full Benefits
· Salary 100K+
· Prior financial experience is a plus!
Key Responsibilities:
* Programming languages including Perl
* Delivering web-systems customized to clients requirements
* Working
c****o
发帖数: 1280
50
来自主题: JobHunting版 - 推荐几本学perl 的书吧?
"Learning Perl" by Randal L. Schwartz, Tom Phoenix, and Brian D. Foy
is a good start, then "Intermediate Perl" maybe. The first one is definitely
good for beginners!
首页 上页 1 2 3 4 5 6 7 8 9 10 下页 末页 (共10页)