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 = <STDIN>;
>       $test = chomp ($test);

chomp $test;
will chomp the last Control character in $test and return 1 or 0
depending on success or failure
What you are doing is chomping $test and then assigning the return
value to the variable, this way you lose the earlier value.

Instead of
>       $test = chomp ($test);
just use
        chomp $test;

Same goes for chop
There are other occurences of chomp and chop, you will have to
change them also.





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

Reply via email to