#!/usr/bin/perl -w # IP ranger use strict; my ($stip,$edip,$count,@openip); open(IPFILE,") { chomp; ($stip,$edip) = split(/:/,$_,2); # split(/:/); print "$stip\n"; print "$edip\n"; @openip = split(/\./,$stip); $count = @openip; print "$count\n"; # you can avoid the creation of the $count # variable and use the following statement # print scalar(@openip), "\n"; # for ($i = 0; $i <= 4; $i++) { # print "@srtip\n"; # }; }; close(IPFILE);