In this case, I think the prof wants you to use an efficient algorithm. I don't think Perl will be a problem. But really, go see your prof! Tell him/her you're interested in practicing your Perl, and ask him/her if he has any problems with you using Perl for this assignment.