Write a program that removes *~ and *.ico files from a directory hierarchy. (Hint: Use the File::Find module.)

What will be an ideal response?


$ cat file-cleanup.pl
use File::Find;
my @starting_points = @ARGV ? @ARGV : '.';
find( \&handle_file, @starting_points );
sub handle_file {
my $name = $File::Find::name;
if ( -f $name ) {
if ( $name =~ /~$/ || $name =~ /\.ico$/ ) {
unlink $name;
}
}

Computer Science & Information Technology

You might also like to view...

All of the Internet's domain names and corresponding IP addresses are stored on a system of computers called the _____.

A. Domain Name System B. Domain Name Server C. Domain Name Service D. Domain Name Database

Computer Science & Information Technology

Describe the mail access vulnerability.

What will be an ideal response?

Computer Science & Information Technology

User-defined styles can be superseded by external styles, which are the styles that a website author creates and places within a Cascading Style Sheets (CSS) file and links to the page.?

Answer the following statement true (T) or false (F)

Computer Science & Information Technology

Which of the following commands can be used in Windows XP to modify when the CHKDSK command runs?

a. SCANDSK b. IPCONFIG c. CONVERT d. CHKNTFS

Computer Science & Information Technology