in reply to Testing for existence of subroutine ref?
Change your if line to this, instead:
if( ref($runmodes->{ $action }) eq 'HASH' ) {
That should do the trick, no?
bbfu Black flowers blossum Fearless on my breath