print ("Enter the number of XML files required to be created:"); $number=; print ("\nEnter the name of the XML file:"); $file_name=; chomp($file_name); $xml=".xml"; $" = ':'; for ($i=1; $i<=$number; $i++) { $files="$file_name$i$xml"; open(FILE, ">$files") or die "Can't open the file: $i\n"; $first="SCS"; $leading = sprintf("%07d", $i); $firstname="$first$leading"; print FILE "\n $firstname "; $mac = sprintf("%012d", $i); @split = ($mac =~ /../g); $ip=sprintf("192168%06d",$i); @splitip= ($ip =~ /.../g); @splitipfinal= join('.', @splitip) . "\n"; print FILE "\n NEW - @split "; print FILE "\n @splitipfinal "; } print "\nThe XMLs have been created, check in the same directory!!";