I have been asked by my manager to write a number of database querying, timestamping, and error reporting scripts and modules.
I have an email script that generates an email with a timestamp and I would like it to report who called the script. Something similar to $0 but for the parent script. I'm quite new to Perl so I don't know all the technical terms.
For example the call would be:
#args(script to be called, subject, message body) my @args = ('sendmail.pl', 'An error has occurred!', Error!'); system(@args) == 0 or die "system @args failed: $?";
And then I would like sendmail.pl to know which script called it without passing additional arguments. Is this possible?
Right now sendmail.pl is just a script but would converting it into a module make things easier (obviously renaming it in the process)? All it does is take arguments and shoots out an email.
Thanks a ton.
Greg
In reply to Filename of parent script available? by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |