From owner-freebsd-questions@FreeBSD.ORG Sun Apr 4 16:05:33 2010 Return-Path: Delivered-To: freebsd-questions@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2A55C1065670 for ; Sun, 4 Apr 2010 16:05:33 +0000 (UTC) (envelope-from perrin@apotheon.com) Received: from outbound-mail-01.bluehost.com (outbound-mail-01.bluehost.com [69.89.21.11]) by mx1.freebsd.org (Postfix) with SMTP id EBEC08FC08 for ; Sun, 4 Apr 2010 16:05:32 +0000 (UTC) Received: (qmail 8429 invoked by uid 0); 4 Apr 2010 16:05:32 -0000 Received: from unknown (HELO box543.bluehost.com) (74.220.219.143) by cpoproxy1.bluehost.com with SMTP; 4 Apr 2010 16:05:32 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=apotheon.com; h=Date:From:To:Subject:Message-ID:Mail-Followup-To:References:Mime-Version:Content-Type:Content-Disposition:In-Reply-To:User-Agent:X-Identified-User; b=n/5h8tMYhxOd/68rQgt09ZlkwUCkNb9POhC2ZwX5iiy3gUO2G6sj6EtRCr7jpGgGd0A66EB+CN+v+hXKUhlJdWKdC5AQ4tHMnWM8ybzOD28QIEhSDc4gD01+nQfhxiSU; Received: from c-24-8-180-234.hsd1.co.comcast.net ([24.8.180.234] helo=kukaburra.hydra) by box543.bluehost.com with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.69) (envelope-from ) id 1NySKI-0003K8-Vp for freebsd-questions@FreeBSD.org; Sun, 04 Apr 2010 10:05:32 -0600 Received: by kukaburra.hydra (sSMTP sendmail emulation); Sun, 04 Apr 2010 09:04:44 -0600 Date: Sun, 4 Apr 2010 09:04:44 -0600 From: Chad Perrin To: FreeBSD Mailing List Message-ID: <20100404150443.GA14567@guilt.hydra> Mail-Followup-To: FreeBSD Mailing List References: <20100403210610.GA4135@thought.org> <4BB8108A.9080104@FreeBSD.org> <1270371713.5861.98.camel@tao.thought.org> <86aatjnsts.fsf@red.stonehenge.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="tKW2IUtsqtDRztdT" Content-Disposition: inline In-Reply-To: <86aatjnsts.fsf@red.stonehenge.com> User-Agent: Mutt/1.4.2.3i X-Identified-User: {2737:box543.bluehost.com:apotheon:apotheon.org} {sentby:smtp auth 24.8.180.234 authed with ren@apotheon.org} Cc: Subject: Re: perl qstn... X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Apr 2010 16:05:33 -0000 --tKW2IUtsqtDRztdT Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Apr 04, 2010 at 08:25:03AM -0700, Randal L. Schwartz wrote: >=20 > Even simpler: >=20 > if (@ARGV) { > print "No args\n"; > } else { > print "arg is $ARGV[0]\n"; > } As Randal noted, he accidentally swapped the conditions here. Just for the sake of absolute clarity, I'll actually swap them: if (@ARGV) { print "arg is $ARGV[0]\n"; } else { print "no args\n"; } >=20 > If you're studying perl, you might want to join the very > beginner-friendly mailing list, info at > http://lists.perl.org/list/beginners.html, or start a conversation on > perlmonks.org, also relatively beginner-friendly. PerlMonks in particular is an excellent resource. I haven't been active there recently, but when I have been active there, I've always found it rewarding and educational. I can't recommend it enough. >=20 > And I'd recommend a couple of good books, but I might be seen as > self-pimping. :) That's okay. I'll pimp them for you. Learning Perl, also known as The Llama Book (because it has a llama on the cover), is one of the all-time best beginner's books for *any* language that I've ever encountered. I've gone through both the second and fourth editions, and both are excellent books. I prefer the organization of the second edition a bit, but the fourth is a trifle more up to date and does a much better job of covering Windows-related Perl development issues. If you're only worried about Unixy development and execution environments, my personal recommendation would be the second edition, though I suppose your mileage may vary. As a follow-up to the Llama, the Alpaca book (it has an alpaca on the cover, naturally) -- in its first edition known as Learning Perl Objects, References, and Modules (or Perl PORM, as I like to call it), and in later editions titled Intermediate Perl -- is also an excellent book. In addition to teaching more about Perl in particular, it also teaches some important general programming concepts from a Perl perspective, thus helping broaden your understanding of programming in general. The final member of the traditional camelid trilogy, and a great book to tack onto the list after the Alpaca, is the Camel Book, titled Programming Perl. It's sorta the definitive reference for Perl programmers, and covers a lot more of the language and its philosophy than the Llama and Alpaca, though in my opinion the Llama and Alpaca together provide a needed introduction that the Camel only skims past (out of necessity, really, since a hand-holding introduction isn't really the book's purpose). There's also Mastering Perl, which was written as a sequel to Intermediate Perl, and I'm sure it's an excellent book. I haven't read it, though, and know next to nothing about it, so I can't really recommend it. All four of the above are published by O'Reilly, and the three I've read at least are each the kind of book that has given O'Reilly its reputation as a purveyor of excellent technical books. Perl is blessed by an absurd number of excellent programming books by knowledgeable authors, and there are many more that are worth your time as well -- but in general the above are the canonical starting steps, with others following from there as you start figuring out what specific areas you want to give your focus next. Unfortunately, there are also a number of really crappy Perl books out there (many books that spell it PERL, in all-capital letters, are among the not-so-great books), and as such I figured I should be explicit in sharing my thoughts on the best books to get started in Perl. Now that I've gotten so far off-topic for this list, I'll return you to your regularly scheduled programming. >=20 > But if you look at http://learn.perl.org/ you'll see a number of other > resources, including free tutorials online. >=20 > print "Just another Perl hacker,"; # the original --=20 Chad Perrin [ original content licensed OWL: http://owl.apotheon.org ] --tKW2IUtsqtDRztdT Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAku4qosACgkQ9mn/Pj01uKWpEQCfQt4uwhU2p54GWqwPr7AM6W28 i9EAmwRsfKYfnRmsNQd+HRKJL7SXxur2 =CPLp -----END PGP SIGNATURE----- --tKW2IUtsqtDRztdT--