#!/usr/bin/perl -w use strict; foreach my $file (glob "*.txt") { unlink $file or print "unable to delete $file\n"; }