Write a subroutine that keeps prompting for a filename


 Exercise 1 &2 

1.   Write a subroutine to prompt the user for any message (like "what is your name?"). The sub will collect the user's answer and return it back to the call (in the main program above the subroutine). Print out the returned string from the sub.

 

2.Write a subroutine that keeps prompting for a filename until a valid file is entered by the user (print out "file found, thanks") or until five attempts have failed (print out "you did not enter a valid file name"). Call the subroutine from the main part of your program. The sub in this case does not return any value. Show the entire program (not just the sub).

Perl Programming Language

Solution Preview :

Prepared by a verified Expert
Programming Languages: Write a subroutine that keeps prompting for a filename
Reference No:- TGS01349870

Now Priced at $25 (50% Discount)

Recommended (98%)

Rated (4.3/5)