in reply to Hash pointing to multiple items

Litterally you can't have a hash point to multiple values. The previous monks are correct in that you can point to an anonymous array of values which brings up the whole subject of nested data structures in Perl. A simplier approach would be to do the following:
$Hash{$ArtistSong1} = '1,3,5'; $Hash{$ArtistSong2} = '2,4';
Not being exactly sure about the meaning of your code, I assume your hash variable is %Hash and that $ArtistSong1 and $ArtistSong2 are keys to your hash. The above code turns your "multiple entries" into a single string entry which you can latter decode thus:
my @songnumbers = split ',',$Hash{$ArtistSong1};
Please let me know more about what your trying to do and I can help you find the data structure you need. be a humble successor

Replies are listed 'Best First'.
Re^2: Hash pointing to multiple items
by holli (Abbot) on Mar 23, 2005 at 20:50 UTC
    For the sake of TIMTOWTDI .. ok. But we don't want to teach bad habits do we?


    holli, /regexed monk/