while (<>) { open IN, $_ || die $!; while () { if (m!https?://([^/"'\s]+)!) { print "'$1'\n"; } } close IN; }