Would something like this help?
$i=1
while(my $line=<STDIN>)
{
chomp $line;
push @integer,$line; # push a scalar onto the array
print "Enter another integer, please: ";
last if ++$i>=10;
}
----- Original Message -----
From: "David Draley" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, September 10, 2001 2:48 PM
Subject: STDIN loop help
> Hello -
>
> I am trying to put an @array in a loop that stores STDIN. Every time I
run
> my program I can't get out of the loop. Is there a command that pushes
the
> program out of the loop or do I need to use $
>
> ----------------
> print "Please enter 10 integer values.\n";
>
> $i = 1;
> while ($i <= 10)
> {
> @integer = <STDIN>;
> chomp @integer;
> print "Enter another integer, please: ";
> $i++;
> }
>
> print @integer;
>
> thank you
>
> David
>
> _________________________________________________________________
> Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp
>
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
>
>
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]