Question: This assignment is to write a Perl script which will allow the user to interactively clean up a directory. For each file found in the

This assignment is to write a Perl script which will allow the user to interactively clean
up a directory. For each file found in the directory by the script the user will be prompted
to either 'delete' the file or 'quit' the process. The Perl script will accumulate the file
names to be deleted and before the script exits the user will be asked a confirmation
question to remove all the selected files.
Program Requirements
The Perl script will take an argument giving the file specification. This can be any
valid shell specification including wildcards.
examples:
delc.pl *(go through all files)
delc.pl *.o (delete object files)
The Perl script will display each file name and query the user whether to delete the
file or 'quit' the process.
example: delete? y,q dir : myfile.txt
The script will inform the user what the file type is (file or directory).
If the user selects 'y'(the delete option) the file name will be stored pending the
deletion confirmation.
If the user selects 'q'(the quit option) the loop will break and take the user to the
final delete confirmation.
At the end of the script the user will be asked a confirmation question to complete
removal of all selected files. The user must specifically affirm the confirmation
prompt with a "Y"(case insensitive) or nothing gets deleted. If nothing gets deleted
the script will print "Nothing has been deleted".
Example: complete all deletions? [y] :
The name of the Perl script will be "
delc.pl". The program submitted will be
tar /gzipped. The command to do this is:
tar czf StudentLastName_cs390program4.tgz
delc.pl
This assignment is to write a Perl script which

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!