It depends on the value(s) you're attempting to return from the perl script - for simple integer values exit is your friend - for more complicated return values, something along the lines you're already following sounds like the way since you've already got it working.
A user level that continues to overstate my experience :-))