fix bug in perl output