in reply to Re^3: Automatic IP address Generation
in thread Automatic IP address Generation

Hi Ikegami , Yes it gives me answer . But the thing is it is also taking the white spaces and also assign them the IP address. i mean it also take the blank lines into consideration

Replies are listed 'Best First'.
Re^5: Automatic IP address Generation
by ikegami (Patriarch) on Jul 30, 2008 at 23:47 UTC
    It doesn't take blank lines into consideration because you didn't mention the possibility of blank lines. Inserting the following at the start of the loop will solve that problem.
    next if /^\s*\z/;