Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Filename of parent script available?
by Fletch (Bishop) on Jul 15, 2005 at 15:43 UTC | |
by Anonymous Monk on Jul 15, 2005 at 15:51 UTC | |
|
Re: Filename of parent script available?
by izut (Chaplain) on Jul 15, 2005 at 16:52 UTC | |
|
Re: Filename of parent script available?
by radiantmatrix (Parson) on Jul 15, 2005 at 17:23 UTC |