I think lots of information on this can be found via google. You'll need the specs for the communication protocol that is used for these servers (or an example program from which you can 'reverse engineer' the protocol). I think
site has some relevant information on programming for HalfLife. The search for Counterstrike information is left as an exercise to the reader.
;-)
I think this might be a great way to learn network programming in perl, and maybe you'll even end up writing modules for these protocols and upload them to