parsing a flat file and removing duplicates
You should probably close the file as soon as you are finished.
Divorcing the open() and close() makes it harder to see maintain.
Move close() to here (just after you finish using the file).
open (YYY, &quot;/home/access_log&quot;);
#assigning flat file to an array
my @incomingarray=&lt;YYY&gt;;
close (YYY);

In the main loop you add overwriten the current values with just the IP address I would not consider this good practice (though it works here because of the simplicity of the program). And since your next step is to convert the array into a hash why not do so directly in the loop.
  $incomingarray[$value] = $ip;

Why not just do:
  $IPlist{$ip} ++; // Increment the count that way you can count each IP.

There is no need to create a new array just to loop over them. You can use the keys directly in the foreach statement to loop over the hash.
my @distinctIP = keys %IPlist;
foreach (@distinctIP) {
  print &quot;$_\n&quot;;
}

Just as easy to write:
foreach (keys %IPlist) {
  print &quot;$_\n&quot;;
}

Two things no note about variables.
Using the automatic variables $_ and @_ make writing the code easier but (in my opinion) also can make the code harder to read and maintain (if overused). This is why perl has got the reputation of being a write once never read or understand again language. So please try and be explicit.
Also all the variables you declare are global scope (you seem to have fixed this). I know for this short program it does not make any difference but a habit you should get into is declaring variables with my. This scopes the variable to the current block (thus making them behave like variables in most other modern languages). By doing this you reduce problems associated with modifying global state accidentally and when you do drop my you know it is on purpose and thus affecting the global version.
Loading the whole array.
Personally I would not have loaded the file into the array and parse it. I would have just read the file line by line and done the appropriate parsing:
#!/usr/bin/perl

use strict;
use warnings;

my %IPList ;
open(YYY, &quot;access_log&quot;);
while(my $line = &lt;YYY&gt;)
{
    chomp $line;
    (my $ip, my $junk) = split(/ - - /, $line);

    $IPList{$ip}++;
}
close(YYY);