in reply to What is this line doing in the perl script?

The line uses a regular expression to capture the canonical name of the object under CN=ExternalContacts in the object name ($this_in) and saves it to $this_mail.
It works as follows:
($this_mail) # puts the value in a list context so that values capture +d by the regex are saved in the list (only the first match will be sa +ved as there is only one variable available) = $this_in =~ # apply a regular expression to $this_in /CN=(.*),CN=ExternalContacts/ # capture the +bit in brackets gio; #apply glob +ally (g), case insensitively (i) and only compile once (o)
print "Good ",qw(night morning afternoon evening)[(localtime)[2]/6]," fellow monks."