Some indentation goes a long way. Excessive comments hurt more than they help. The dot in your regex is not matched literally, it's a wildcard for "(nearly) any character". You're slurping the file, which could easily lead to a lot of memory consumption on busy sites with large logfiles. Testing
$#ARGV including equality to zero means you have to pass at least two parameters, since with a single element the result will be 0 and trigger your condition.
#!/usr/bin/perl -w
use strict;
@ARGV = qw(/var/log/apache/access_log) unless @ARGV;
my %source;
while(<>) {
next unless /cmd\.exe/;
my ($ip) = /^(\S+)/;
$source{$ip}++;
}
printf "%-6s %10s\n", $source{$_}, $_ for keys %source;
printf "%15s %10s\n", "Total:", scalar keys %source;
Untested.
Makeshifts last the longest.