Need help with PERL Assignment?

We are supposed to be creating a menu that deletes, finds, view, edit a file, etc. I am stuck as to what to do to get it to remove the file that is inputted. If you guys can help me with the first one, then I am sure it should work for the others. This is due in 4 days! Thanks for your help. Below is what I have so Far:

#!/usr/bin/perl
# Program Name: mathperl.pl

while ($again ne 'n')
{
print ("\n");
print ("\n");
print ("\n");
print ("*******************************************************************");
print ("\n");
print (" Please choose and action to perform");
print ("\n");
print ("*******************************************************************");
print ("\n");
print ("\n");
print (" 1 - Delete A File \n");
print (" 2 - Find A File \n");
print (" 3 - Displays file \n");
print (" 4 - List Items In A Directory \n");
print (" 5 - Edit A File \n");
print (" 6 - Quit \n");
print ("\n");
print ("\n");
print ("What would you like to do? ");
chomp($answer = <STDIN>);
("\n");
print ("\n");
print ("\n");
print ("\n");
if ($answer eq "1")
{
print ("What file would you like to delete? ");
$delanswer == <STDIN>;
rm delanswer
print ("Would you like to continue? ");
$again = <STDIN>;
chomp ($again)
}

elsif ($answer eq "2")
{
print ("What file would you like to find? ");
$finanswer = <STDIN>;
find -name $finanswer;
print ("Would you like to continue? ");
$again = <STDIN>;
chomp ($again)
}
}
*** before some say to put the $ in front of delanswer, I have.
okay, I found out how to delete now. Now if you guys could tell me what the other commands are. There is Find a File, Display a file via CAT, View items in a directory, and Edit a file in VI
 
Back
Top