in reply to Text output problem

Use lc to make your input case-insensitive:
use warnings; use strict; my @password = ('foo'); print "Do you want to export your password to a text file? (y/n) "; chomp(my $export = <STDIN>); $export = lc $export; if ($export eq 'y') { open (FH, '>>password.txt') or die $!; print FH "Your password is: ", @password, "\n"; close FH; } elsif ($export eq 'n') { print "Your password is: ", @password, "\n"; } else { print "Enter either y or n to continue. \n" ; }
You do use strict and warnings, don't you? See also Equality Operators.