or you could just change this:
my $vInput = @_;
to thisL
my $vInput = @_[0];
-Original Message-
From: Barry Carroll [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, August 07, 2001 12:03 PM
To: '[EMAIL PROTECTED]'
Subject: Newbie Question about subroutine
Hi all, i want to have a subroutine f
e
# and discard bad values
my ($vInput) = @_;
..
}
just put the sclar in brackets :)
-Original Message-
From: Mooney Christophe-CMOONEY1 [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, August 07, 2001 5:19 PM
To: '[EMAIL PROTECTED]'
Subject: RE: Newbie Question a
On Tue, 7 Aug 2001, Barry Carroll wrote:
> here is a snippet of the code:
>
> print ("Is your Terminal ANSI compliant?\nYes or No, \(y\) or \(n\)?\n");
First of all, get rid of those backslashes. No need to put your string in
parens. You can do this:
print "Is your Terminal ANSI compliant?\nY
@_ is a list and $vInput is a scalar. A list in scalar context returns the
number of elements in the array.
So,
$vInput=@_
will put the number of elements in @_ into $vInput, which, naturally, is
always one.
To extract the single argument from the list, do this:
$vInput=shift;
This will tak