At least, look at the manual page, and deduce how comm is implemented. It works on sorted files. Big hint! So, using this big blinking hint, how would I implement this?
Sort both files.
Open both files.
If one of the files is empty, the lines in the other file are unique to said file. Then you're done.
Read a line from both files.
If lines are equal, they appear in both files. Goto 4.
If the line from the first file is less then (string wise) the line from the second, it's unique to the first file. If the first file doesn't have more lines, the rest of the lines in the second file are unique to it. Then you're done. Else, read a line from the first file and goto 5.
The line from the second file is unique to it. If you have exhausted the second file, the rest of the first file are lines unique to it, and you're done. Else read the line from the second file and goto 5.
Translating that to Perl is left as an exercise to the user who gets paid for it.