in reply to feeding a menu from script

see if this will help you:

$menu = <STDIN>; &delete_files if($menu == 1); &makdir if($menu == 2); # and so on. sub delete_files { # stuff goes here }

dont know is it what you want.