## Assigns email address to each ticket number $x=0; while() { chop; $ticket{$x++}=$_; ## or push(@ticket, $_); }