in reply to Splitting a dynamic comma-separated list.

my ($temp) = 121, 122, 123, 124, 125, etc...
my $temp = "121, 122, 123, 124, 125, 126"; my @userids = split /\s*,\s*/, $temp;
This will split your scalar containing a comma-separated list of values into an array containing each of those values. The array will automagically have as many elements as necessary.