I hope to design an interface of a function like this (not in OO way) :
sub tell_error
{ print Error for @_ }
sub Check_err
{ my %argv = @_;
}
Check_err ( TYPE = [1, 1, \tell_error('Type')], DATA = [ 1, 2, \tell_error
('Data')] );
In Check_err, I want tell_error ('Type')
sub tell_error
{ print Error for @_ }
Check_err ( TYPE = [1, 1, \tell_error('Type')], DATA = [ 1, 2,
\tell_error ('Data')] );
You can't take a reference to a function WITH ARGUMENTS. You must either
do
foo = \function
or
foo = sub { function(args) }
Since you want to pass arguments,