Loop through the list and check each one to decide if it belongs to player X or not.  If it does, do the thing you want to do, otherwise, skip it. 
 
The debate is if there is a way currently exposed to Perl that allows you to tie a merc to a player.  As Trevius said above, GetOwner() might work.  I haven't messed with Mercs on the emu yet, but if they are named like they are on live then it might be possible to get at the <Soandso's mercenary> string and match them that way. 
		
	
		
		
		
		
		
		
		
		
		
	
		
		
	
	
	 |