in reply to QUERY ABOUT A SECTION OF A CODE

%h is hash table. $file is a scalar variable and contains file name and unlink $file, deletes the file.

my $file = 'file'.$pixel.'.jpg';

It means that $file = file1000x1000.jpg (is a string type). It concatenates the strings i.e. file, value in $pixel and .jpg as one string. Concatenation

You need to read about perl first and then ask questions: perldoc, learn Perl