I’m learning about network security and I want to create a simple port scanner using Perl. My goal is to scan a target machine and identify open ports. I’ve worked with Net::Ping in Perl before, but I’m not sure how to implement a basic port scan to check for open TCP ports on a range of IP addresses or a specific host.
Could someone provide a basic example of how I could write such a script? I’m interested in understanding how the code works, especially when it comes to handling connection attempts and timeouts.