There is a selenium command for almost anything you want to do in testing a web page. For example, using the IDE you will find a number of store commands, such as storeText. I have found that frequently the fastest way to find out how to do something with a selenium test in Perl (my experience with Selenium is almost all front end through the IDE) is to add an appropriate command in the IDE and then export to Perl to see the syntax used.
So, for storeText I found the example boiled down to:
my $text = $sel->get_text("//xpath");