Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 04 Apr 2010 08:25:03 -0700
From:      merlyn@stonehenge.com (Randal L. Schwartz)
To:        kline@thought.org
Cc:        glarkin@FreeBSD.org, FreeBSD Mailing List <freebsd-questions@FreeBSD.org>
Subject:   Re: perl qstn...
Message-ID:  <86aatjnsts.fsf@red.stonehenge.com>
In-Reply-To: <1270371713.5861.98.camel@tao.thought.org> (Gary Kline's message of "Sun, 04 Apr 2010 02:01:53 -0700")
References:  <20100403210610.GA4135@thought.org> <4BB8108A.9080104@FreeBSD.org> <1270371713.5861.98.camel@tao.thought.org>

next in thread | previous in thread | raw e-mail | index | archive | help
>>>>> "Gary" == Gary Kline <kline@thought.org> 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
<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?86aatjnsts.fsf>