Something like this:
while ( 1 ) {
    printf "Please enter file to delete:";
    chomp(my $filetodelete = <STDIN>);
    last if ( $filetodelete =~ /^exit$/i );
        printf "Deleting file: %-s\n", $filetodelete;
        while ( 1 ) {
           printf "Do you want to delete<N/Y>?: ";
         chomp(my $MyResp = <STDIN>);
           if ( $MyResp eq '' ) {
            $MyResp = 'N';
          }
           if ( uc($MyResp) eq 'Y' ) {
            unlink($filetodelete) || warn "Problems with deleting the file:
$!";
        }
       last;
     } # end of inner loop
 }

A starting point.

Wags ;)
-----Original Message-----
From: Jakob Kofoed [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 08, 2003 12:38
To: [EMAIL PROTECTED]
Subject: delete file


Hi,

How can I delete a file in a script - but get the script to ask me if I
really want to delete this file - and then wait for the yes or no answer?

Thanks,

Jakob


**********************************************************
This message contains information that is confidential
and proprietary to FedEx Freight or its affiliates.
It is intended only for the recipient named and for
the express purpose(s) described therein.
Any other use is prohibited.
****************************************************************


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to