perl qstn...

Randal L. Schwartz merlyn at stonehenge.com
Sun Apr 4 15:25:06 UTC 2010


>>>>> "Gary" == Gary Kline <kline at 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 at 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


More information about the freebsd-questions mailing list