Q:

How to delete files based on the extension in perl?

I have a problem regarding deletion of files in Perl. I want to delete all files within a folder with the extension .log. Is there a smart way to do this in Perl? 
I haven't got much experience coding perl.

A:

Fast and dirty: unlink glob('*.log');.
I'd recommend manual loop with opendir/readdir over directory for more control though.

