Date: Tue, 06 Apr 2010 07:28:57 -0700 From: merlyn@stonehenge.com (Randal L. Schwartz) To: Giorgos Keramidas <keramida@ceid.upatras.gr> Cc: glarkin@FreeBSD.org, kline@thought.org, FreeBSD Mailing List <freebsd-questions@FreeBSD.org> Subject: Re: perl qstn... Message-ID: <86d3yciriu.fsf@red.stonehenge.com> In-Reply-To: <874ojor7e4.fsf@kobe.laptop> (Giorgos Keramidas's message of "Tue, 06 Apr 2010 17:18:59 %2B0300") References: <20100403210610.GA4135@thought.org> <4BB8108A.9080104@FreeBSD.org> <1270371713.5861.98.camel@tao.thought.org> <874ojor7e4.fsf@kobe.laptop>
next in thread | previous in thread | raw e-mail | index | archive | help
>>>>> "Giorgos" == Giorgos Keramidas <keramida@ceid.upatras.gr> 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 <merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/> Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc. See http://methodsandmessages.vox.com/ for Smalltalk and Seaside discussion
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?86d3yciriu.fsf>