Simpler and more effective in perl