Place your files in /usr/lib/cgi-bin, make them executable and change the owner and group to www-data:
sudo cp myscript.pl /usr/lib/cgi-bin/
sudo chown www-data.www-data /usr/lib/cgi-bin/myscript.pl
sudo chmod 0755 /usr/lib/cgi-bin/myscript.pl
I prefer to enable the "AddHandler cgi-script .cgi" line in /etc/apache2/mods-available/mime.conf by removing the "#" in front of it and setting "Options +ExecCGI" for the directories below /var/www where scripts should be executed. But beware: Everything executable ending with ".cgi" will be executed as a cgi script this way.