in reply to script for deleting html, images and css from server

die unless ( $answer eq 'Y' or 'y' );

Your syntax is off here. or does not bind strong enough, and even if it did, 'Y' or 'y' will always result in 'Y'.

You will need to write something like:

die unless ( $answer eq 'Y' or $answer eq 'y' );