Hello all, what am i missing!!!!!!!
#!/usr/bin/perl -w
@array_number =<STDIN>;
@new_array = half( @array_number );
print "@new_array\n";

sub half {
  @numbers = @_;
     while (<@numbers>){
     @n = $_ / 2;
     @new_a = pop(@n);
   }
     return @new_a;
}

#I am calling a sub function "half".
#but it return only the last element in to @new_array.
#here what i am exception.
#input      return
#1 --------> 0.5
#2 --------> 1
#3 --------> 1.5
Thanks.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to