in reply to Making a code shorter
Since you imported the standard CGI package, there is no need to create the OO cgi object:
Removing all those $q->'s might cut it down a bit too.$q = new CGI;
In Section
Seekers of Perl Wisdom