in reply to Re^2: Use temporary file or cache
in thread Use temporary file or cache

Try to read perlintro or perldata for more information on hashes, and perlreftut for more involved data structures. Suppose you have a comment stored in $comment, and want to store that it's related to the url $post_url, you'd write:
my %comments; ... push @{$comments{$post_url}}, $comment;

And you can retrieve and iterate over the list of comments to an URL:

for my $c (@{$comments{$post_url}}) { print "$c\n"; }