<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.6000.16705" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN 
class=992230718-10092008>Hi,</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN 
class=992230718-10092008></SPAN></FONT>&nbsp;</DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN 
class=992230718-10092008>If I understood correctly - you're going to run the 
script containing record_info subroutine&nbsp;from another 
script...</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN 
class=992230718-10092008>In this case you can do the next:</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN 
class=992230718-10092008>1. Run record_info_script with the&nbsp;command line 
argument: </SPAN></FONT><FONT face=Arial color=#0000ff size=2><SPAN 
class=992230718-10092008>`/path/record_info_script.pl $0`</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN 
class=992230718-10092008>2.&nbsp;Then use&nbsp;@ARGV in the 
record_info_script.</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN 
class=992230718-10092008></SPAN></FONT>&nbsp;</DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN 
class=992230718-10092008>Otherwise (if there is only one script and&nbsp;you 
need just find out its name)</SPAN></FONT><FONT face=Arial color=#0000ff 
size=2><SPAN class=992230718-10092008>&nbsp;see $0 
description.</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN 
class=992230718-10092008></SPAN></FONT>&nbsp;</DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN 
class=992230718-10092008>Regards,</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN 
class=992230718-10092008></SPAN></FONT>&nbsp;</DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN 
class=992230718-10092008>Sergei</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN 
class=992230718-10092008></SPAN></FONT>&nbsp;</DIV>
<DIV dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> 
sanfrancisco-pm-bounces+sergey.fetisov=ask.com@pm.org 
[mailto:sanfrancisco-pm-bounces+sergey.fetisov=ask.com@pm.org] <B>On Behalf Of 
</B>Richard Reina<BR><B>Sent:</B> Wednesday, September 10, 2008 11:05 
AM<BR><B>To:</B> sanfrancisco-pm@pm.org<BR><B>Subject:</B> [sf-perl] How to find 
out what script is calling a subroutine?<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV dir=ltr>If I have a script such as<BR><BR>#!/usr/bin/perl -w<BR><BR>sub 
record_info {<BR><BR>&nbsp;# insert some into into a DB 
table<BR><BR>}<BR>1;<BR><BR><BR>Is there a way that the subroutine record_info 
can tell what perl script called it so that it can also put that info in to the 
DB table?<BR><BR>Thanks very much for your help.<BR></DIV></BODY></HTML>