in reply to A Matter of Style in CGI

As a matter of style I'd move your html generation out in templates and use something like HTML::Template or Template::Toolkit. You have the advantage of editing the look and feel of your HTML without the risk of accidently modifying your code.

$q->a({-href=>"emp-list.cgi?sort=emp_id"}

Consider something like $query->url(-full=>1); this way you can change the name of your CGI without having to hunt thru' your code to find the references to your hardcoded (tm) script name.

Personally, if i were producing the above i would abstract the database routines into a seperate module make the call, return the data, then turn it into html. You have the advantage of reusable code, and a single maintaince point.