[wellylug] Getting user input into a Perl program

Cliff Pratt enkidu at cliffp.com
Sat Jan 28 22:34:11 NZDT 2006


I'm probably overlooking the obvious, but is there some way of getting 
user input into a Perl program?

eg, what sort of stuff do I put in the sub 'ask_for_input'? In the case 
below, it would presumbly do something like ask "Continue (Y/N)?" and 
parse the response and return a true value if it gets a negative 
response and would break out of the loop.

while (1) {
	do_stuff() ;
	last if(ask_for_input()) ;
	do_more_stuff() ;
}


-- 

http://barzoomian.blogspot.com




More information about the wellylug mailing list