hello!
i want to input some numbers via <stdin> in while loop.And loop should be
broken if any nonnumeric character is entered.So how it can be checked.

........................
.........................
my @ln;
my $i=0;
print"Give line numbers you want to put into array.\n";
while(1){
 $ln[$i]=<stdin>;
 chomp $ln[$i];
 if($ln[$i] =~ /\D/){
  print"Its not numeric value.\n";
  $i--;
  last;
 }
 $i++;
}
.............................

One more query:-
HOW TO REMOVE ANY ELEMENT FROM AN ARRAY.
I mean if i have allocated till arr[5]. Now I want to remove the value
arr[4] and arr[5]. So how it can be done so that $#arr would tell 3.

Reply via email to