Using Perl to query a website and parse the result

Hi,
I am a JAVA programmer and I have no idea about perl. I did use it a long time ago and I don't even remember the basics. So here is my problem:

In my work, I am supposed to build a simple program that opens a website (Gene Ontology)and passes my query and returns the result into a file. The program input into the terminal looks like this :

 program.pl -s m|c|b -f filename

Here m, c and b are three types of queries and only one type will be passes into the program.
Can someone help me out? I have no idea who this can be done in perl and I can't use JAVA or python for this. The output has to be piped into a file.

Try,

LWP::UserAgent - Web user agent class - search.cpan.org