perl qstn...

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

>>>>> "Gary" == Gary Kline <kline at> 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, or start a conversation on, 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 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> <URL:>
Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.
See for Smalltalk and Seaside discussion

More information about the freebsd-questions mailing list