in reply to transfer form vbs to perl

while (<DATA>) { print "$_\n" for /(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}:\d{1,4})/gi; } __DATA__ some stuff 10.0.0.1:80 stuff 127.0.0.1:22 more stuffs 10.2.2.8:8080 nothing here 3.4.5.6:1 100.200.100.200:3000
You can change the code to following, save it to file named script.pl and run it like so: perl script.pl < file.txt
use strict; use warnings; while (<>) { print "$_\n" for /(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}:\d{1,4})/gi; }