From owner-freebsd-questions@FreeBSD.ORG Tue Apr 6 14:28:57 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 AE95B106564A; Tue, 6 Apr 2010 14:28:57 +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 95D4C8FC1D; Tue, 6 Apr 2010 14:28:57 +0000 (UTC) Received: by red.stonehenge.com (Postfix, from userid 1001) id 461A9758D; Tue, 6 Apr 2010 07:28:57 -0700 (PDT) From: merlyn@stonehenge.com (Randal L. Schwartz) To: Giorgos Keramidas References: <20100403210610.GA4135@thought.org> <4BB8108A.9080104@FreeBSD.org> <1270371713.5861.98.camel@tao.thought.org> <874ojor7e4.fsf@kobe.laptop> x-mayan-date: Long count = 12.19.17.4.10; tzolkin = 2 Oc; haab = 3 Pop Date: Tue, 06 Apr 2010 07:28:57 -0700 In-Reply-To: <874ojor7e4.fsf@kobe.laptop> (Giorgos Keramidas's message of "Tue, 06 Apr 2010 17:18:59 +0300") Message-ID: <86d3yciriu.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, kline@thought.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: Tue, 06 Apr 2010 14:28:57 -0000 >>>>> "Giorgos" == Giorgos Keramidas writes: Giorgos> This means you can write your sh version like this in Perl: Giorgos> #!/usr/bin/perl Giorgos> if (int(@ARGV) == 0) { Giorgos> die "No args; at least one filename expected"; Giorgos> } Giorgos> printf("%s\n", join(' ', (@ARGV))); Which, when you're not speaking Perl with a C accent, expressed more "natively" as: @ARGV or die "No args: at least one filename expected"; print "@ARGV\n"; -- 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