Re: Newbie question in Perl

2002-12-30 Thread R. Joseph Newton
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

Re: Newbie question in Perl

2002-12-30 Thread John W. Krahn
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

Re: Newbie question in Perl

2002-12-30 Thread George P.
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 = ; >

Newbie question in Perl

2002-12-30 Thread Anand Ramakrishna
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