If you're talking about vuln scanner, I'd suggest :
nessus (my favourite one), or even whisker (written in Perl)...
If you're talking about detecting intrusion, a search with IDS as keyword will bring you tons of results :
Portsentry, Snort, Hostsentry, NFR, Tripwire, Toby...
Anyway
a list of excellent security tools is available
here (thanks to fyodor).
"
Only
Bad
Coders
Code
Badly
In
Perl" (OBC2BIP)