Your variables $name, $country and likely $phone contain newlines. If you're reading them in from a file or from user input, you likely want to remove the newline:
... get input ... chomp $name; chomp $country; chomp $phone;
See chomp for documentation of it...
In reply to Re: not writing to .txt file properly
by Corion
in thread not writing to .txt file properly
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |