Hi kardon33,
I don't want to be glib, but I would go straight to the documentation and books about the subject.
perldoc IO::Socket::INET
The O'Reilly Perl Cookbook has examples on doing just what you describe:
17.4 Setting Up a UDP Client
17.5 Setting Up a UDP Server.
Pick up a copy and it will step you through it.
- Miller