Monitor outgoing port for traffic on Linux

I have a powershell script that works for this in Windows but I have limited perl experience;  Has anyone created this for SAM?