Problem 2 Create a script using only Perl that first prompts the user for the exit condition (exit/quit/or blank space)

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899604
Joined: Mon Aug 02, 2021 8:13 am

Problem 2 Create a script using only Perl that first prompts the user for the exit condition (exit/quit/or blank space)

Post by answerhappygod »

Problem 2
Create a script using only Perl that first prompts the user for
the exit condition (exit/quit/or blank space) and then goes into a
loop waiting for the exit condition.
The program screen output should look like this:
"Enter exit, quit or blank space to exit the program."
While in the loop, catch the control-c signal and keep track of
how many times the control-c key is pressed (this must not
cause your program to exit).
When an exit condition is given, using perl commands,
create/open a file named results.txt.
Write the number of times control-c was pressed after exiting
the loop and save the file. Make sure you handle the
file properly.
The file should look like this (depending on the results):
The user did not press control-c (this is the case if control-c
was not pressed before exiting)
The user pressed control-c X times (where X is the number of
times control-c was pressed)
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply