LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 07-21-2005, 09:50 AM   #1
eagle683
Member
 
Registered: May 2005
Posts: 38

Rep: Reputation: 15
dumb question


In a perl program, if you want to exit cleanly say in a menu, if you type exit.

how do you exit the program. I can't find out how to do it. I've tried the exit() function and exit keyword. I've also tried using system("exit") without luck.

Any tips?

It's getting annoying to ctrl+c all the time.

eagle
 
Old 07-21-2005, 10:06 AM   #2
aluser
Member
 
Registered: Mar 2004
Location: Massachusetts
Distribution: Debian
Posts: 557

Rep: Reputation: 43
The exit function works as expected -- post the rest of your code : )
 
Old 07-21-2005, 10:20 AM   #3
eagle683
Member
 
Registered: May 2005
Posts: 38

Original Poster
Rep: Reputation: 15
nevermind, dumb mistake I figured out what it was:

if you are curious it was


while ($input !~ /exit/)
{
with lots of different sutff in here


elsif ($input =~ /exit/)
{
exit();
}

#loop back to top
}
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
dumb question xedios Linux - Software 6 08-31-2004 02:24 PM
dumb question... ktambascio General 5 03-30-2004 08:27 PM
dumb question? scooter6175 Linux - Newbie 3 08-05-2003 08:24 PM
Dumb question Thetargos Linux - Software 3 05-06-2003 07:31 PM
A really dumb question jkcunningham Linux - General 6 07-20-2002 11:57 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 06:23 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration