in reply to A thought about usability in Perl and Linux in general.

You can write scripts that do it both ways. Just check for @ARGV, if they exist, go on with the script. If they are not there, prompt the user for values.

Installing Perl from source is a good example of this. A minimal example is:

#!/usr/bin/perl use warnings; use strict; my $count = 0; if( $ARGV[0] ){ $count = $ARGV[0]; }else{ print "Enter integer to count to, and press return\n"; $count = <>; chomp $count; } for(0..$count){ print "$_\n"; }

I'm not really a human, but I play one on earth. flash japh

Replies are listed 'Best First'.
Re^2: A thought about usability in Perl and Linux in general.
by holli (Abbot) on May 18, 2005 at 12:37 UTC
    From the OP:
    but whenever I write a small command line script [...] I always have it prompt for input if none is specified.
    Period.


    holli, /regexed monk/
Re^2: A thought about usability in Perl and Linux in general.
by DrHyde (Prior) on May 19, 2005 at 09:58 UTC
    In the Unix world, invoking the command without parameters generally makes it choose a set of well-documented defaults.

    Prompting for parameters is also reasonable, but if you do that, please check that STDIN is a tty using the -t test.