Tuesday, 20 August 2013

Detect how a subroutine is called in Perl

Detect how a subroutine is called in Perl

I would like to detect how a subroutine is called so I can make it behave
differently depending on each case:
# If it is equaled to a variable, do something:
$var = my_subroutine();
# But if it's not, do something else:
my_subroutine();
Is that possible?

No comments:

Post a Comment