文盲是什么意思| 容易中暑是什么原因| 核磁共振是什么| 感冒全身酸痛吃什么药| 菠萝与凤梨有什么区别| 乌黑乌黑的什么| 基础代谢率是什么意思| 柠檬水有什么功效| 看病人送什么| 梦见西红柿什么意思| 什么叫应激反应| 白完念什么| 简单明了是什么意思| 1975年是什么命| 鼻炎和鼻窦炎有什么区别| 奠基什么意思| 热感冒吃什么食物好| 甘薯和红薯有什么区别| 不然呢是什么意思| 急性胰腺炎是什么病| 结扎对男人有什么伤害| 头皮痒掉发严重是什么原因| 梦见买面条有什么预兆| 吃黄瓜对身体有什么好处| 椰子水是什么味道| 身体缺钾吃什么可以补充| 拉拉秧学名叫什么| 记性差是什么原因| 看正月初一是什么生肖| 慢性支气管炎吃什么药| 肺结核钙化是什么意思| 手腕长痣代表什么意思| 脚趾缝脱皮是什么原因| 腰疼肚子疼是什么原因引起的| 氯是什么意思| 包皮过长挂什么科| 最近爆发什么病毒感染| 梦见自己的衣服丢了是什么意思| 苦尽甘来是什么意思| 晚上睡觉放屁多是什么原因| 什么像什么又像什么| dpm值是什么意思| 医院附近适合做什么生意| 什么榴莲好吃| 对牛弹琴告诉我们什么道理| 马蜂窝治什么病最好| 肚脐右边疼是什么原因| 越来越什么| 什么是血液病| 酱油是什么时候发明的| 平板和ipad有什么区别| 女生的阴道长什么样| 嗜酸性肉芽肿是什么病| 幽门螺旋杆菌感染吃什么药| 01年属蛇的是什么命| 朱顶红什么时候剪叶子| 什么叫语言障碍| 淤血是什么意思| 雏凤是什么意思| 舌头发麻是什么情况| 风油精有什么作用| 右胸痛什么原因| 肾功能不全是什么意思| 水瓜壳煲水有什么功效| birkin是什么意思| 围绝经期是什么意思| 7.12是什么星座| 早餐吃什么英语怎么说| 小腿痒痒越挠越痒是什么原因| 早上起床头晕是什么原因| 血糖高适合吃什么| 竹子可以做什么| 吕布属什么生肖| 血糖高能喝什么粥| 缺陷的陷是什么意思| 山宗读什么| 猪八戒是什么佛| 量贩式ktv什么意思| 电销是什么| 辅料是什么意思| 政府是干什么的| 脑梗是什么引起的| 天机不可泄露是什么意思| 血糖高不能吃什么食物| 曲高和寡什么意思| 颈椎钙化是什么意思严重么| 女人舌苔厚白吃什么药| 平胸是什么原因导致的怎样解决| 捡漏什么意思| 夏天吃什么蔬菜好| 十月6号是什么星座| 得之坦然失之淡然是什么意思| 伐木是什么意思| 女性手麻是什么原因| 横空出世什么意思| 肽是什么| edenbo是什么牌子| 为什么会这样| 8月7日什么星座| 猫的尾巴有什么用处| 王晶老婆叫什么名字| 上火嗓子疼吃什么药| 秀才相当于什么学历| 雨对什么字| 奶茶喝多了有什么危害| 曹字五行属什么| 胃出血吃什么食物好养胃| 腿抽筋是什么原因| 成都人民公园有什么好玩的| 梦是什么意思| 腋窝淹了用什么药| 乳腺癌有什么症状| 2044年是什么年| 孕酮起什么作用| eric是什么意思| 极有家是什么意思| 藏风聚气是什么意思| who是什么意思| 平板电脑与笔记本电脑有什么区别| 小孩拉肚子吃什么药好| 小孩查微量元素挂什么科| 口加女念什么| 尿血是什么原因女性| 乳腺癌挂什么科| 口腔溃疡吃什么好| 为什么今年这么热| 什么加什么等于红色| 阿迪耐克为什么那么贵| 竹代表什么生肖| 疑难杂症是什么意思| 胃胀呕吐是什么原因| 单亲家庭是什么意思| 睡觉腰疼是什么原因| 腹胀是什么病的前兆| 什么时候种香菜| 说话不清楚去医院挂什么科| 奕五行属性是什么| 乌黑对什么| 用什么洗脸可以美白| 喝莓茶对身体有什么好处| 飞克手表什么档次| 腿发麻是什么原因| 住房公积金缴存基数是什么意思| 过指什么生肖| 头皮起疙瘩是什么原因| 冷面是用什么面做的| 肝硬化早期吃什么药| 龟头责是什么意思| 什么的樱桃| 卵巢多囊症是什么原因造成| 活字印刷术是什么时候发明的| 左耳嗡嗡响吃什么药| 什么叫单亲家庭| 女性绝经有什么征兆| 有伤口吃什么消炎药| 周公解梦是什么意思| 层次是什么意思| 明朝北京叫什么| 为什么挠脚心会痒| 自渡是什么意思| 国家为什么要扫黄| 40岁男人学什么乐器好| 农历7月20日是什么星座| 囊性结节是什么意思| 白气是什么物态变化| 一什么知什么| 蝙蝠吃什么| 拐子是什么意思| 捡帽子有什么说法吗| 排便困难用什么药| 干咳嗽无痰是什么原因| 结婚年数代表什么婚| 211是什么| spiderking是什么牌子| 什么时候不能喷芸苔素| 月经不停吃什么药| 激光脱毛和冰点脱毛有什么区别| 11月17日是什么星座| 鲸鱼用什么呼吸| 刚怀孕要吃些什么好| 2003年是什么命| 什么的小虾| 宫颈炎和阴道炎有什么区别| 普洱在云南什么位置| p.a.是什么意思| 物色什么意思| 100聚酯纤维是什么面料| 白塞氏病是什么病| 全友床垫属于什么档次| 云南白药的保险子是起什么作用的| 蓝得什么| 文化是指什么| 万金油是什么意思| 最近有什么新闻| 色丁布是什么面料| 泡妞是什么意思| 属龙的和什么属相最配| 马骝是什么意思| 飞机什么东西不能带| 六点半是什么时辰| 青色是什么样的颜色| 迷茫什么意思| 芒果与什么食物相克| 人到中年为什么会发胖| 被蜱虫咬了有什么症状| 没壳的蜗牛叫什么| 为什么会尿频尿急| 吃什么能提神不打瞌睡| 籍贯是填什么| 平安扣适合什么人戴| 为什么一喝酒就头疼| 口腔脱皮是什么原因引起的| 灬是什么意思| 雀神是什么意思| 胰腺在人体起什么作用| 水牛是什么意思| 唐筛是检查什么| 小孩缺铁有什么症状| 7.2什么星座| 柳是什么生肖| 死库水是什么意思| 桔子树用什么肥料最好| 女人体检都查什么项目| 女人吃什么| 蛇为什么怕雄黄| 非萎缩性胃炎伴糜烂吃什么药| 三是什么意思| 风的孩子叫什么| 什么赴什么继| 蛋白尿是什么原因引起的| 产妇月子吃什么下奶多| 什么样的| 血小板平均体积偏高是什么意思| 创伤性关节炎有什么症状| 阿卡波糖什么时候吃| 麒麟飞到北极会变成什么| 痔疮不能吃什么东西| 怀孕一个月出血是什么情况| 弹性是什么意思| 双子座和什么座最配对| 可可尼女装什么档次| 什么是肺结核| 留级是什么意思| 260是什么意思| 什么地看| 阴道口有点痒用什么药| 为什么身份证后面有个x| 王字旁的字跟什么有关| 梦中梦是什么原因| 脑浆是什么颜色| 纳气是什么意思| 细菌感染有什么症状表现| 痛风能吃什么| 相害是什么意思| 白带发黄粘稠是什么原因| 孟子是什么时期的人| b型血和o型血生的孩子是什么血型| 肾钙化是什么意思| 白衣天使是什么意思| 好老公的标准是什么| 猫鼻支是什么症状| 肾积水吃什么药最好| 突然头晕冒虚汗什么原因| 428是什么意思| 百度

Tuesday, April 18, 2006

Interview with Steve Oualline of Wicked Cool Perl Scripts


Perlcast is back with another interview. This one is with Steve Oualline, the author of "Wicked Cool Perl Scripts".





云南对农村婚丧喜庆事宜“订标” 宴请每桌费用不超200元



Introduction



Josh



百度 很难说这是一种“报复性反弹”,但现实就是如此残酷,孩子们、家长们往往无法真正从中抽身。


Welcome to Perlcast. This is your host, Josh McAdams, here with another great interview with a member of the Perl community. This interview is with Steve Oualline, the author of numerous books including the more recent, "Wicked Cool Perl Scripts", published by No Starch Press.



As a bonus, No Starch Press will be giving away a few promotional copies of "Wicked Cool Perl Scripts". To be entered the drawing, simply send an email to perlcast+wicked at gmail.com. That's perlcast, the plus sign, wicked, at gmail.com. Get those entries in by May 1st 2006 to be eligible for the drawing.



Interview



Josh




Welcome to Perlcast. Today I have Steve Oualline. Steve is the author of "Wicked Cool Perl Scripts". And, welcome to Perlcast Steve.



Steve




Thank you very much.



Josh




Well, first of all, I guess we'll start by asking, judging from your history of authorship you're a C and C++ programmer, as well as, a Perl programmer. How did you find Perl?



Steve




Well, I'm tempted to answer "I just looked in /usr/bin/ and there it was". But, what happened is, is that I'd been looking at scripting languages for a while and Perl seemed to rise to the top for dealing with things you don't want to write a formal program for. And, just want to get something written fast that works and is fairly simple. And the most selectable language to do that.



Josh




Well, the book is written assuming that the reader already knows Perl. So how much of a Perl expert should you be to actually use this book?



Steve




I think you should have a working knowledge and be able to do the basics. Know how to write a basic program. Know how to download something from CPAN. Which is actually one of the strengths of Perl is you can let somebody else write most of the work and put something together. We don't try into some of the tricky stuff, but just show you how to do the everyday work that you do. It's more of a working-class book than anything else. So if you've done enough Perl that, you know you can write a subroutine, you can do the basics, you can go from there.



Josh




There is a huge range of scripts that you cover in this book. And that goes from website management to CGI programming, system administration, games, photos, development, and even a little bit of mapping. Is there any audience in particular that you were trying to address or were you just going for everybody with this book?



Steve




I was mostly just trying to show people the wide range of problems that Perl can solve in a way that's rather interesting, because, you know, you've got some things there that, oh it was designed for system administration. Well, we do system administration. But there is so many things that you can put together fairly easily, fairly quickly, such as the time I used it to make maps from my Grand Canyon hike. And, found all that information on the web that could easily be downloaded and displayed. And the real interesting thing now is I've got a two-year old daughter is learning computers and Perl has helped her with the basic keyboard use and now is even taught her now how to find letters on the keyboard. She's working her way up. So, it's just fun.



Josh




I thought that was really impressive. The a, the scripts that you had actually written for your daughter that you had in that book. Whenever you went to originally write the book, did you already know that you were going to cover all of that or did it just kind of come about?



Steve




Well, I had a number of things that I'd been using it for already and, as for my daughter, that sort of came about during that. She was learning about the keyboard the hard way at that time because she would see me typing and insist on typing and was very upset that I wouldn't let her write the book too. So, we had to get her to play in a nice way with the computer and that's how the, that's how the first script came about. And, now she's on her second one. And we're going from there.



Josh




There seems to be quite a few UNIX and Linux specific commands embedded in some of those scripts. Would you consider UNIX to be a necessity for readers of this book?



Steve




I would say it is mostly a necessity. You can take some of things, a lot of the things, and move them to Windows, but I designed it with Linux or UNIX in mind. Mostly because, that's where the real adventure comes in. I found that people that are using Linux and Windows [means to say UNIX] are sort of push, they use the technology to push their work forward. And, most of the people I found that are using Microsoft Windows, you're spending your time programming things around the limitations that Windows has set up for you.



Josh




In one section of the book you write a comic spider. And, has the website that you spidered changed since writing the book. Because, I know Randal Schwartz had an issue with that. Like, just after he had published a print spider, that the website went and changed like a day after the print.



Steve




I don't know because I haven't been using that particular program a lot. I know that they've done some new stuff and some old, those are editorial cartoons and they are constantly changing the artist on that. But the whole thing is designed to show you how you can adjust the spider to pick out exactly what you want. And that was the main thing. And yeah, I expect the people to be able to go down and if somethings not working, to fix it. I mean this is for, the audience I consider are not dummies, they are people that, yes, we don't have everything in there, we don't have slick GUI, this is something that works and what doesn't work, you can tweak it a little bit.



Josh




In looking through some of your code examples, I noticed that your regular expressions had just a very interesting and verbose way of commenting them. Where did you pick that up?



Steve




I have been in the, working in the area of, what do I want to say, literate, not literate programming, but trying to make programs clear for about, oh, twenty-five years now in various forms and various languages. So I'm always picking up techniques for making things better. And one of the things that happens is, I have learned how to use ASCII to draw pictures and do other graphic things. And so this is a natural fallout of that. Is to have to draw lines to annotate things in order to make something clear. And, regular expressions are a particular challenge because it an extremely compact language for the expressions themselves and you've gotta get something in there to explain it. And that just seemed to be the natural fallout of that.




It's interesting because when I first started working in programming in programming about twenty-five years ago, they said the next great thing that was coming was marrying the word processor to the compiler so that you'd embed graphics and fonts and other things and make your programs look pretty and you wouldn't have to be stuck with this monospaced courier type font. And, I'm still waiting for the day that they do that to make our programs clear because we're still stuck with that silly type font. Till then I'm gonna make due the best I can with all sorts of techniques and that's just one of them. I mean, some other things that I wind up doing are underlining words with equal-signs to make a level-one heading in a, in a comment, or using stars to try to make something look semi-bold. And, just get around the limitations of that silly font we're stuck with.



Josh




It is amazing that programmers still are the few people that use plain-text files for everything, so.



Steve




Yeah.



Josh




On that note, and this is just kind of a side comment. Have you seen or read Damian Conway's "Perl Best Practices" yet. Because he mentions something else there that seems cool also, and that's the x-modifier on regular expressions. I think that mixed with your commenting would be a, you could really explain what was going on.



Steve




In a previous book called "Perl for C Programmers", I actually show what happens, what it takes. You take a very messy regular expression and you you comment it my way and then you use the dash-x so that you can comment it the way that Damian has. And, what happens is, is that with my way you get this very very vertical big mess. And with Damian's way, you get this horizontal big mess. And the conclusion I've got is is that, if you're gonna start out with a big mess, even commenting it is still a big mess unfortunately. And, really it has to do with just trying to figure out which better. Either the vertical way that I've done or the horizontal way that can be done with the dash-x. My best is to try to avoid some of those regular expressions if I can help it.



Josh




I also noticed that you use CGI::Thin instead of the CGI module. When and why should programmers use CGI::Thing instead of CGI?



Steve




What I was looking at was a rather simple interface to the CGI stuff. And, in general I, I tend to not like CGI itself because it is so much stuff stuffed in there. Especially when it comes to the generation of the HTML. I sort of consider that overkill because, if you know HTML, then you can write it directly. And, if you don't know HTML, the functions provided by CGI aren't going to help you. So, why not just, instead of hiding the HTML inside of function layers, just write it yourself.




You also don't need so much of an object-oriented interface for something that is not going to have multiple instances. There is no way in the CGI basic infrastructure to support multiple connections for a single CGI program. It sits there and runs, it does it's job and it stops and that's it. And, that's what you have to deal with. So, I always felt like, that CGI itself was overkill and I was just looking for something that was simple to use, didn't, and fairly fast loading, and that seemed to be the CGI::Thin module.



Josh




In your CGI scripts you also always used taint mode. How important is it to actually use that?



Steve




I consider sort of the three things necessary for any Perl program, and that is 'use strict', 'use warnings', and if you, if you're running CGI, 'use taint'. And, the taint is of absolute importance because it prevents the user from injecting bad data and just really causing all sorts of problems with your system. Because, a lot of what CGI programs do is pass parameters off to outside programs. Well, if you wind up crafting those parameters, the answers to a lot of the stuff that you have on the form, in a malicious way, you can cause all sorts of trouble. And, so taint mode prevents you from taking anything from the user and passing it directly to a program without checking it for sanity or sanitizing it. And, so it hopefully prevents a lot of problems, and that's why they put it in there, was to prevent this stuff from coming in.




So, it's a basic security check I consider about as important as locking your front door when you leave the house every morning.



Josh




There was one thing that I never heard before that I thought was really interesting and that was just a side-bar you had about the history of the carriage-return and line-feed. Was that a true story or was that just for entertainment purposes?



Steve




No, that's actually a true story. When I first started working, the first computer I had was connected up with a ASR33 teletype, which was state of the art communications back in 1930. I mean that's when they considered ten characters per second high-speed. And, if you look at the history of that, soon after they first made the telegraph they realized that one of the problems that they had is people had to understand Morse Code and they spent years trying to make things so you didn't need that. And the teletype was one of those that fell out of that and was rather successful. And, the teletype was a mechanical beast. It's a very interesting thing if you ever take a look at it because the keyboard ROM is made out of, entirely out of levers. The shift register that is used to transmit the character looks like a distributor cap on a car. And, it's entirely electromechanical. No transistors in it. And it works if you ever keep it in adjustment, which my boss at the time did. But, he said the teletype is made out of adjustments it's not made out of parts. And I saw what happened once because we had a teletype set up that carriage-return, did a carriage-return line-feed. And, you had to put a null character after the carriage-return or it tried to print a character on the fly going back, actually doing the carriage return you get a blob right in the middle of the page.



Josh




One of the scripts you'd done was a regular expression grapher. And, that was just insane how much work it seemed like that took. How long did it take you to write?



Steve




I don't know how long it took me write because it was written somewhat piecemeal. I would use redebug to get some raw data for the regular expression grapher and then just graph those nodes. And, although it looks very very complex, the guts of it are fairly simple. It's just that each different type of regular expression has to have different subroutine for graphing it and it just sort of grew over time.



The only thing I remember about that was is that drawing arcs is a real pain in the ass and I've got them wrong about eight different ways before I finally got them right. And this actually goes back to the regular expression commenting you were talking about earlier because if you look through that, one of the things you see is for each one of those nodes where I've got like three or four arcs that are pointing to a regular expression, I've actually tried to draw it in ASCII above the subroutine itself so I could understand what I was doing. And, yeah, drawing, drawing arcs in ASCII is a real fun thing but, I did the best I could.



Josh




Impressed me. I was shocked to see that in the book.



And, there at the end of the book there was also, there was a page dedicated to the Electronic Frontier Foundation. Was that your doing or is that the publisher?



Steve




I believe that was my doing because I'm a strong believer in what they stand for. And, especially considering some of the silliness that goes on here right now with the criminalizing of what used to be 'fair use'. And, I think that, you know, it gets to the point now where, on this podcast I can tell you that you can encode letters by writing down the alphabet A through Z and shifting the letters thirteen spaces to the right and writing them down. Now that will create an encoding system. I can't tell you how to decrypt that thing, because if I did tell you how to decrypt that thing, I could be subject to five years in jail and have to pay a half-million dollar fine. Because that encryption, even as stupid as it is, actually does protect some copyrighted works. And, it's against federal law to tell me that. Now, any seven year old can figure it out, but you can tell anybody that because it's criminalized. And it just gets, some of the stuff our government does, it's just insane.



So, every once in a while, somebody has to ask the question of the government, you know, "What do you think your doing and how crazy is it?". And, EFF is doing that. Especially in the area that I'm interested in, which is the technology.



Josh




Thank you for putting that in the book. I think you've already covered the other question about the book's more about getting the job done than theory. That's definitely a fair statement for this, I believe?



Steve




Yeah, I mean, I consider myself not at the bleeding edge and not figuring out all of the little obscure things. I just want to beat down the language and get something done. And, the other books that I've done have the word 'practical' in their name, which is, is pretty much how I'm at. It's just get the job done, get it done as simple as possible and as clear as possible and make it work. I mean I work for a living. I have to deal with this stuff on a day-to-day basis. So, you do the best you can.



Josh




I didn't cover that. I know you've mentioned one so far, and that was "Perl for C Programmers". What other titles have you done?



Steve




"Perl for C Programmers" is the big one for the Perl users. And, in a lot of cases my books are competing with several books of the same level. "Perl for C Programmers", I consider one of my strongest books because it really takes Perl and approaches it a way I haven't seen other books do. Other books seem to be Perl for Perl programmers, which to me is a little bit hard to learn Perl unless you already know it. Where as mine starts out with an entirely different thing.



The others that I've done in the C and C++ area have been "Practical C Programming", "Practical C++ Programming". One of the latest from No Starch is "How Not to Program in C++", which is one hundred and one broken programs and a couple of working ones. And that one is rather fun because I manage to break "Hello World" in a couple of ways. Well, those pretty much are the main ones. I've got a number out there that are not in print any more which I don't even remember. And, I don't know.



Josh




That's all the questions I have about "Wicked Cool Perl Scripts" and is there anything else that you'd like to leave us with?



Steve




That's about it. The scripts are downloadable, and the are downloadable from either the No Starch website or my website, which is www.oualline.com.



Closing



Josh




Thanks once again to Steve for allowing me to interview him and thank you for listening to Perlcast. Don't forget to enter the drawing for a promotional copy of "Wicked Cool Perl Scripts", just send an email to perlcast+wicked at gmail.com by May 1st 2006.



The GarageBand.com artist that is featured in this podcast is A Thousand Cures with the track Motions.

近视眼底改变什么意思 长长的什么 老年痴呆症挂什么科 肛门口瘙痒涂什么药膏 室性期前收缩是什么意思
康波是什么意思 舌苔厚腻是什么原因 气管炎吃什么药最有效 蕈是什么意思 灸石门为什么会不孕
什么是窦性心律不齐 nicole是什么意思 ab型rh阳性是什么意思 曲安奈德针治疗什么 液基薄层细胞学检查是什么
世界上最长的英语单词是什么 强制是什么意思 痔疮用什么药治最好效果最快 牙龈肿痛用什么药好得快 脚真菌感染用什么药最好
巨蟹座的幸运色是什么颜色hcv7jop6ns3r.cn 甲状腺3类是什么意思hcv9jop3ns5r.cn 腿长身子短有什么说法hcv8jop0ns9r.cn 风凉话是什么意思aiwuzhiyu.com 手和脚脱皮是什么原因hcv8jop8ns1r.cn
落花生是什么意思hcv9jop2ns8r.cn 脸部填充用什么填充最好hcv7jop6ns7r.cn 风波是什么意思hcv8jop5ns9r.cn 开塞露擦脸有什么效果hcv8jop7ns9r.cn 尿道结石有什么症状hcv8jop2ns7r.cn
胡塞武装是什么hcv9jop4ns4r.cn ozark是什么牌子jinxinzhichuang.com 不可名状的名是什么意思helloaicloud.com 失独是什么意思hcv9jop8ns1r.cn 柒牌男装什么档次hcv9jop2ns1r.cn
oce是什么牌子helloaicloud.com 早餐吃什么不升血糖jingluanji.com 中秋节吃什么hkuteam.com 农历4月是什么星座1949doufunao.com 六月初六什么节hcv9jop6ns3r.cn
百度