Hi Anand,
Look at your logic:
until (($test ne 'Y') && ($test ne 'N') &&
($test ne 'y') && ($test ne 'n')) {...} #until BAD input
This says that as long as there is good input, keep cyckling until you get bad input.
You should either use while here, or change the condition to refle
Anand Ramakrishna wrote:
>
>
> Hi,
Hello,
> I am a beginner to perl. I have written a simple program in Perl
> # This Program will copy the contents of a file named file.txt to another file
> # newfile.txt. If newfile.txt is already existing, the user is given an option
> # to overwrite the
On Mon, 30 Dec 2002, Anand Ramakrishna wrote:
> if (-e "newfile.txt")
> {
> print "WARNING !! FILE newfile.txt already exists\n";
> print "Do you want to destroy all the contents and overwrite the file\n";
> print "Type Y for Yes or N or NO\n";
> $test = ;
>
Hi,
I am a beginner to perl. I have written a simple program in Perl
# This Program will copy the contents of a file named file.txt to another file
# newfile.txt. If newfile.txt is already existing, the user is given an option
# to overwrite the file and chose a new file name to write the ou