How to return from Perl

I have an enterprise scheduler that's calling a Perl script and they are saying that they need a return code rather than the perl script printing out the results.  I tried to use return, but got an error that says "can't return outside a subroutine".  How do I return from the main in perl?  thanks
jhughes4Asked:
Who is Participating?
 
Adam314Connect With a Mentor Commented:

#If everything is okay
exit(0);
 
#If there was a problem
exit(1);  #or some other non-zero number

Open in new window

0
 
ozoCommented:
perldoc -f exit
0
 
ozoCommented:
Did you read the documentation I referenced?
0
 
Adam314Commented:
Sorry ozo... I skipped over your comment when I made my post.
0
All Courses

From novice to tech pro — start learning today.