#! perl use warnings; my $useridfile = 'userids'; open USERIDS, $useridfile or die "Couldn't open $useridfile; reason $!"; my (@userids) = (); close USERIDS or warn "Couldn't close userid file:$!"; for my $count (0 .. (scalar @userids) - 1) { print "userid[$count]=", $userids[$count]; } __END__ #if the file "./userids" contains: 121 122 123 124 125 126 #the above program would give C:\test>185550 userid[0]=121 userid[1]=122 userid[2]=123 userid[3]=124 userid[4]=125 userid[5]=126 userid[6]=127