sub write_flag{
print "Success for flag.\n";
}
sub write_sets{print "Success for Set.\n"; }
sub do_nothing{print "Exit Here\n";}
my %Op = (
set_to_flag => \&write_flag,
set_tree => \&write_sets,
default => \&do_nothing
);
sub build_sth{
my ($op_code) = @_;
print "\n\nCode: $op_code:\n";
my $op_exec = $Op{$op_code} ;
if(defined($op_exec)){
print "it exist: $op_exec\n";
}else{
print "Oop\n";
}
}
####
build_sth('set_to_flag');
####
Oop
####
Can't use string ("") as a subroutine ref while "strict refs" in use at ...