It depends on what lies inside the $k elements of @$data, but either way, you may want to move your foreach loop to something roughly like:
print<<_WML_;
<?xml version='1.0'?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN"
"http://www.wapforum.org/DTD/wml_1.1.xml">
<wml>
<card title="smsbook" id="smsbook">
_WML_
my ($data,$rows) = &get_sms($dbh,$userid);
my $k;
foreach $k (@$data){
print "<p>", @$k, "</p>\n";
}
print "
</card>
</wml>
";
He who asks will be a fool for five minutes, but he who doesn't ask will remain a fool for life.
Chady | http://chady.net/