if ( exists $func{$sub} ) { $func{$sub}->($data) } else { $func{one}->($data) }