Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

How to return from Perl

Posted on 2008-10-16
4
Medium Priority
?
240 Views
Last Modified: 2012-05-05
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
0
Comment
Question by:jhughes4
  • 2
  • 2
4 Comments
 
LVL 85

Expert Comment

by:ozo
ID: 22733344
perldoc -f exit
0
 
LVL 39

Accepted Solution

by:
Adam314 earned 2000 total points
ID: 22733523

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

Open in new window

0
 
LVL 85

Expert Comment

by:ozo
ID: 22733625
Did you read the documentation I referenced?
0
 
LVL 39

Expert Comment

by:Adam314
ID: 22733730
Sorry ozo... I skipped over your comment when I made my post.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In the distant past (last year) I hacked together a little toy that would allow a couple of Manager types to query, preview, and extract data from a number of MongoDB instances, to their tool of choice: Excel (http://dilbert.com/strips/comic/2007-08…
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Six Sigma Control Plans

885 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question