Refer to the apache_access.log file. Every row is a request on a web server. Some are pages, some are images, some are JavaScript files. That’s not important right now though. We are going to focus on the first field of every line, which is the IP address of the requester.
Please see attached File
As you know, every device uses the IP address 127.0.0.1 to refer to itself. So, visitors arriving from that IP address are coming from the same machine. Your task is to write a scriipt that will count how many requests came from 127.0.0.1 and how many from elsewhere. For your submission, please provide your code for review.
Basic steps:
1. Open the file for reading or die
2. Chomp remove trailing newlines
3. Use index function
4. Use substr function
Note: You may also use a regular expression (regex) if you want.