old attempt at AC-3 Perl script