Hi,
how do you know if the passed argument is an integer, pointer to an array, pointer to a harsh, or whaever?
for ex.
sub a{
my $a = shift;
if($a is an interger{ ...}
elsif($a is a pointer to a string){...}
elsif($a is a pointer to an array){...}
elsif($a is a pointer to a harsh){...}
return whatever
}
and i can call this a() like this
a($int);
a(\@a);
a(\%a);
...
how do i do that?
how do you know if the passed argument is an integer, pointer to an array, pointer to a harsh, or whaever?
for ex.
sub a{
my $a = shift;
if($a is an interger{ ...}
elsif($a is a pointer to a string){...}
elsif($a is a pointer to an array){...}
elsif($a is a pointer to a harsh){...}
return whatever
}
and i can call this a() like this
a($int);
a(\@a);
a(\%a);
...
how do i do that?