TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Ask HN: How did you learn Perl/Shell Scripting?

4 点作者 sk2code超过 11 年前
Please suggest Links, Books & Blogs (if possible).

8 条评论

kadabra9超过 11 年前
Aside from the typical methods I used to pick up other languages (trial and error, practicing with sample projects, banging my head against the desk), the two most helpful resources I found were the book Modern Perl (<a href="http://modernperlbooks.com/books/modern_perl/chapter_00.html)and" rel="nofollow">http:&#x2F;&#x2F;modernperlbooks.com&#x2F;books&#x2F;modern_perl&#x2F;chapter_00.html...</a> a site I stumbled upon titled &quot;Learn Perl in about 2 and a half hours&quot; (<a href="http://qntm.org/files/perl/perl.html" rel="nofollow">http:&#x2F;&#x2F;qntm.org&#x2F;files&#x2F;perl&#x2F;perl.html</a>).
porlw超过 11 年前
From the perl man page (back when it was all one page)<p>When I was a student I took an internship at a small software company in the English countryside.<p>I was given the task of fixing 100 or so Oracle Forms (version 3, still based on green screen technology). A field in the database was being resized from 1 to 2 characters, and I had to fix the display layouts and any related variable declarations in the code.<p>The Oracle forms editor had a terrible UI, I had to navigate around the form and drill down in each block or UI element to see the related code. There&#x27;s wasn&#x27;t much of a search facility. After a bit I decided there had to be a better way.<p>I started by grepping the forms files, to see where the code was referenced. This helped, but didn&#x27;t tell me where in the form the code was, so I still had to navigate around the form looking for the places it was used.<p>I&#x27;m not sure why I picked up on perl, but I printed out 90-odd pages from man, spent some time reading through, and came up with a script that did a high-level parse of all the form files and told me which forms and code blocks contained references to the field.<p>The other developers thought that this task would keep the intern distracted for a few weeks, but I finished within a few days.<p>So they game me another pile of more complex changes to do. Sigh...<p>Other than that the Camel book is good, and the perl Cookbook.
Wicher超过 11 年前
I learned shell scripting mostly from... actually using the shell as the mothership of mostly any activity I undertake on my machines, be it at work or at home.<p>The experience you gain by trying not to repeat yourself carries over into scripting, especially if you already know regular imperative programming constructs: you can then just look up how a specific construct is implemented in your shell of choice.<p>I daily (or maybe hourly) use flow control constructs inline in shell commands, making heavy use of I&#x2F;O redirection, exit statuses, etc. I&#x27;ve been doing this for over ten years now and I&#x27;m still progressing, finding more efficient ways of doing things (currently trying to make a habit of using ZSH&#x27;s advanced globbing capabilities).<p>If you run a barebones keyboard-oriented desktop environment &#x2F; window manager (I use wmii) it becomes very attractive to not have to take your fingers off the keyboard; each little efficiency increment is its own reward. But it&#x27;s the slow path.<p>But you asked for links, books and blogs, not my personal experience ;-)<p>This blog is has some OK articles on Perl&#x2F;Shell:<p><a href="http://www.catonmat.net/blog/" rel="nofollow">http:&#x2F;&#x2F;www.catonmat.net&#x2F;blog&#x2F;</a>
Patrick_Devine超过 11 年前
The book that really helped me out the most with Perl was &quot;Effective Perl Programming&quot; (aka &quot;Silver Ball&quot; due to the original cover). Here&#x27;s a link: <a href="http://www.amazon.com/Effective-Perl-Programming-Idiomatic-Development/dp/0321496949" rel="nofollow">http:&#x2F;&#x2F;www.amazon.com&#x2F;Effective-Perl-Programming-Idiomatic-D...</a><p>The thing I liked most about that book was that it really helped me get a grasp on Perl idioms and start writing decent, readable Perl code. The thing you&#x27;ll find out quickly about Perl is that it can be much easier to write than it is to read. I&#x27;ve written more than my fair share of Perl code which I&#x27;ve let rot for a while, tried coming back and reading and been left scratching my head.
runjake超过 11 年前
FYI, Perl not PERL.<p>Perl -&gt; Programming Perl &amp; Perl Cookbook. Unsure how relevant these still are as &quot;Modern Perl&quot; is the big paradigm now.<p>Shell -&gt; UNIX Shell Programming by Stephen Kochan. I got around in shell before this, but his book make me effective and competent.
评论 #7026884 未加载
jfaucett超过 11 年前
I cant speak for Perl but when it comes to bash&#x2F;shell scripting, I&#x27;ve got a few links for you :)<p>First have look at the Linux Document Project (<a href="http://www.tldp.org/guides.html" rel="nofollow">http:&#x2F;&#x2F;www.tldp.org&#x2F;guides.html</a>), the Bash Guides are really good, thats how I first got started. Also, for bash once you&#x27;ve gone through the guides, download the source (apt-get source bash if your own a debian based distro) and checkout the test suite, this will give you a good look at the internals.<p>Also be sure to memorize the ins and outs of the the man command :)<p>Best of luck
ramsaysnuuhh超过 11 年前
I learned Perl initially for sysadmin&#x27;ing from Minimal Perl (<a href="http://www.amazon.com/Minimal-Perl-Unix-Linux-People/dp/1932394508" rel="nofollow">http:&#x2F;&#x2F;www.amazon.com&#x2F;Minimal-Perl-Unix-Linux-People&#x2F;dp&#x2F;1932...</a>). It teach a subset of Perl necessary to use it as a more powerful replacement for awk&#x2F;sed&#x2F;grep&#x2F;find, primarily with one-liners. By far the best bang&#x2F;buck of any programming book I&#x27;ve ever read.
dllthomas超过 11 年前
I learned perl from the camel and llama books, but I think there are probably better resources these days.<p>I don&#x27;t remember when I first started learning bash... I found some gems in the Advanced Bash Scripting guide (<a href="http://www.tldp.org/LDP/abs/html/" rel="nofollow">http:&#x2F;&#x2F;www.tldp.org&#x2F;LDP&#x2F;abs&#x2F;html&#x2F;</a>) but that&#x27;s probably not the place to start (and I&#x27;ve recently heard some criticism of it).