M
Martin Kissner
hello together,
I have a sub, which can be called by different other subs.
There are some slight differences depending from which sub it is called.
Is it possible to find out, which other sub called the actual sub?
I have writen the following script for demonstration:
Would it be possible to find out which sub called "who_called_me"
without passing the strings to it?
Best regards
Martin
-----
#!/usr/bin/perl
use warnings;
use strict;
one();
sub who_called_me {
my $who = shift;
print "$who called me\n";
}
sub one {
who_called_me("one");
}
sub two {
who_called_me("two");
}
I have a sub, which can be called by different other subs.
There are some slight differences depending from which sub it is called.
Is it possible to find out, which other sub called the actual sub?
I have writen the following script for demonstration:
Would it be possible to find out which sub called "who_called_me"
without passing the strings to it?
Best regards
Martin
-----
#!/usr/bin/perl
use warnings;
use strict;
one();
sub who_called_me {
my $who = shift;
print "$who called me\n";
}
sub one {
who_called_me("one");
}
sub two {
who_called_me("two");
}