AGI->get_data() ,# dtmf doesnt works

Hi.
I am developing a song portal.i am using perl for agi scripts.While listning song caller can press 1 to listen next song,# to listen previous song,0 for jumping to main (start) context.if no dtmf is pressed ,next song is played automatically.
in perl agi ,my code is…
do{
my $fileopt = “”;
$fileopt = $AGI->get_data("/home/song1", 100, 1);
if($fileopt eq “”){
$fileopt = “1”;
}
}while(($fileopt ne “1”) and ($fileopt ne “2”) and ($fileopt ne “0”) and (ord($fileopt) != 35));

in above code pressing # doesnt store any value in $fileopt.I have searched this on internet but couldnt find any thing which could help me.
if any one know how to handle # dtmf .then please tell me. i am stuck here.Remember i have to use only # dtmf for this purpose and no other key.
thanks in advance
Regards
Adnan