i cant for the life of me figure out what's wrong with this perl program. it takes the first input, and then freezes after that, missing all the other lines. anyone who can solve this (probably simple) problem for me, i'd really appreciate it!
print "Please enter names, enter X to quit: ";
@a[0] = <STDIN>;
chomp(@a[0]);
$n = 0;
print " @a ";
while(@a[0] ne "X"
{
while(@a[$n-1] ne 'X')
{
print "Please enter name: ";
@a[$n] = <STDIN>;
chomp(@a[$n]);
$n++;
}
}
@a = sort(@a);
print " @a ";
thanks!
matt
print "Please enter names, enter X to quit: ";
@a[0] = <STDIN>;
chomp(@a[0]);
$n = 0;
print " @a ";
while(@a[0] ne "X"
{
while(@a[$n-1] ne 'X')
{
print "Please enter name: ";
@a[$n] = <STDIN>;
chomp(@a[$n]);
$n++;
}
}
@a = sort(@a);
print " @a ";
thanks!
matt