> > >But how could I take two arguments from the command line: > >i.e. my guess: > >%Test.pl "Foo" "Bar" > >#/!/usr/bin/perl > $A = $ARGV[0]; > $B = $ARGV[1]; > print "Thing A: $A Thing B: $B"; >
I think you already answered your own question! Though your shebang line should be "#!/usr/bin/perl". Other ways of doing this are: #!/usr/bin/perl ($A, $B) = @ARGV; #!/usr/bin/perl use strict; # Lets be strict and explicitly declare $A and $B. my ($A, $B) = @ARGV; #!/usr/bin/perl use strict; # After this @ARGV will be two elements shorter. # if @ARGV contains ('foo.txt','bar.txt','another.txt','yetanother.txt') now my $A = shift @ARGV; my $B = shift @ARGV; # then @ARGV contains ('another.txt','yetanother.txt') now. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]