Uri Guttman wrote:

>   CS> foreach (@hping_array){
> 
> foreach my $ping ( @hping_array){

Uri showed right above how to avoid using $_. eg instead of:

foreach ( @hping_array ) {
        $_ + 10;
        #...60 lines of code
        print "$_\n";
}

do:

for my $ping_result ( @hping_array ) {
        $ping_result + 10;
        #... 60 lines of code
        print "$ping_result\n";
}

You will appreciate this in longer programs, as it is very clear as to
what the variable is for, and which scope it belongs to.

Steve

-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to