in reply to Array Problem

Other comments:
$j = 1 until ($j == 255) { ... $j++; ... }
This will loop from 1 to 254, perhaps not what you want. Alternatives:
$j = 1; while ($j < 256) { ... }
or
for my $j (1..256) { }
Also consider Net-Ping.

Replies are listed 'Best First'.
Re^2: Array Problem
by wanderinweezard (Initiate) on Jul 08, 2005 at 15:28 UTC
    Thanks for your ideas, but I really do want it to just do 1 through 254, but I do like the the
    for my $j (1..256) { }
Re^2: Array Problem
by monarch (Priest) on Jul 08, 2005 at 16:19 UTC
    Just curious about the logic behind this correction..

    Given that the network address (.0) and the broadcast address (.255) is rarely used for hosts (assuming last digit of a Class C network) then one would rarely want to ping the .255 address.

      Well, I was going to say something about the evils of until/unless, but was really too tired to be coherent, so didn't end up saying all I meant. In other words, questioning the bounds was just an excuse to question the structure.