From owner-freebsd-questions@FreeBSD.ORG Sun Apr 4 15:25:06 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 B837F1065680 for ; Sun, 4 Apr 2010 15:25:06 +0000 (UTC) (envelope-from merlyn@stonehenge.com) Received: from red.stonehenge.com (red.stonehenge.com [208.79.95.2]) by mx1.freebsd.org (Postfix) with ESMTP id 049728FC24 for ; Sun, 4 Apr 2010 15:25:03 +0000 (UTC) Received: by red.stonehenge.com (Postfix, from userid 1001) id 9C1935E52; Sun, 4 Apr 2010 08:25:03 -0700 (PDT) From: merlyn@stonehenge.com (Randal L. Schwartz) To: kline@thought.org References: <20100403210610.GA4135@thought.org> <4BB8108A.9080104@FreeBSD.org> <1270371713.5861.98.camel@tao.thought.org> x-mayan-date: Long count = 12.19.17.4.8; tzolkin = 13 Lamat; haab = 1 Pop Date: Sun, 04 Apr 2010 08:25:03 -0700 In-Reply-To: <1270371713.5861.98.camel@tao.thought.org> (Gary Kline's message of "Sun, 04 Apr 2010 02:01:53 -0700") Message-ID: <86aatjnsts.fsf@red.stonehenge.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: glarkin@FreeBSD.org, FreeBSD Mailing List 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 15:25:06 -0000 >>>>> "Gary" == Gary Kline writes: Gary> #!/usr/bin/perl Gary> $argc = @ARGV; Gary> if (! $argc ) { Gary> printf("No args; need filename.\n"); Gary> } Gary> else { Gary> printf("%s\n", @ARGV); Gary> } Even simpler: if (@ARGV) { print "No args\n"; } else { print "arg is $ARGV[0]\n"; } 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. And I'd recommend a couple of good books, but I might be seen as self-pimping. :) But if you look at http://learn.perl.org/ you'll see a number of other resources, including free tutorials online. print "Just another Perl hacker,"; # the original -- Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095 Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc. See http://methodsandmessages.vox.com/ for Smalltalk and Seaside discussion