in reply to Splitting a dynamic comma-separated list.

If your list is a scalar then the previous replies will work excellently, if you mean 'list' as an array reference, i.e.: my ($temp) = [121, 122, 123, 124, 125, etc...] you could use
foreach $id (@$temp) { # do things with $id }
or if you wanted a different way, you could assign it to a hash:
@hash{@$temp}=@$t; foreach $id (keys %hash) { # do things with $id }
with this method you can use the hash to determine if your id exists using the id itself, e.g.
if ($hash{120}) { # id 120 exists }
TMTOWTDI!

--
hiseldl