Re: What is my name

2003-11-04 Thread Kevin Pfeiffer
In article <[EMAIL PROTECTED]>, Brian Gerard wrote: > And the clouds parted, and Kevin Pfeiffer said... [...] >> If I don't escape the slash in the char class -- i.e. /([^\/]+)$/ -- I >> get this error: >> Unmatched [ in regex; marked by <-- HERE in m/([ <-- HERE ^/ at ./test-0 >> line 7. >> >> T

Re: What is my name

2003-10-31 Thread randy epperson
There is a much simpler way of getting the path and the filename - use File::Basename; my ($rfile, $dirname) = fileparse($roriginal_file); # split up the file name works very well. randy "Brian Gerard" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > And the clouds parted, and Kev

Re: What is my name

2003-10-31 Thread Brian Gerard
And the clouds parted, and Kevin Pfeiffer said... > > > > Here's a line that will give you exactly that. > > ($PROGNAME = $0) =~ s|(\.?\.?(/[^/]+)*/)?([^/]+)|$3|; > > I have two questions... > > I came up with this earlier today: > my ($program) = $0 =~ /([^\/]+)$/; > > Doesn't it do the same?

Re: What is my name

2003-10-30 Thread Kevin Pfeiffer
In article <[EMAIL PROTECTED]>, Brian Gerard wrote: [...] > I ran into exactly this issue, but I wanted to just get the actual script > name. $0 returns the entire path the script was invoked as. ie - $0 > could be "../../foo/bar/blarch/scriptname.pl", but I just wanted > "scriptname.pl". > > He

RE: What is my name

2003-10-30 Thread Dan Muey
> > On Thursday 30 Oct 2003 5:11 pm, Yannick Warnier wrote: > > > Le jeu 30/10/2003 à 17:56, Gary Stainburn a écrit : > > > > You can write $0 as well as reading it, which will change what > > > > appears when you run ps etc. > > > > > > > > This can be usefull for security reasons such as hiding

Re: What is my name

2003-10-30 Thread Wiggins d Anconia
> On Thursday 30 Oct 2003 5:11 pm, Yannick Warnier wrote: > > Le jeu 30/10/2003 à 17:56, Gary Stainburn a écrit : > > > You can write $0 as well as reading it, which will change what appears > > > when you run ps etc. > > > > > > This can be usefull for security reasons such as hiding sensitive d

Re: What is my name

2003-10-30 Thread Brian Gerard
And the clouds parted, and [EMAIL PROTECTED] said... > Hi, > > I have a little problem. I have script "test.pl" and inside this script I want to > know what is "my name" (I mean this "test.pl". > > test.pl script > --- > > my $this_scripts_name_is = who_am_I(); > > sub who_am_I > {

Re: What is my name

2003-10-30 Thread Gary Stainburn
On Thursday 30 Oct 2003 5:11 pm, Yannick Warnier wrote: > Le jeu 30/10/2003 à 17:56, Gary Stainburn a écrit : > > You can write $0 as well as reading it, which will change what appears > > when you run ps etc. > > > > This can be usefull for security reasons such as hiding sensitive data > > passed

Re: What is my name

2003-10-30 Thread Yannick Warnier
Le jeu 30/10/2003 à 17:56, Gary Stainburn a écrit : > You can write $0 as well as reading it, which will change what appears when > you run ps etc. > > This can be usefull for security reasons such as hiding sensitive data passed > on the command line, and also for returning status information f

Re: What is my name

2003-10-30 Thread Gary Stainburn
On Thursday 30 Oct 2003 12:06 pm, Sudarshan Raghavan wrote: > [EMAIL PROTECTED] wrote: > >Hi, > > > >I have a little problem. I have script "test.pl" and inside this script I > > want to know what is "my name" (I mean this "test.pl". > > $0 will contain the program name > perldoc perlvar You can w

RE: What is my name

2003-10-30 Thread Dan Muey
> The $0 variable already has it so no need for a sub or a new > variable. One thing is sometimes it reurns path info also > /home/joemama/test.pl That may or may not be a bad thign > depending on what you're doing. > > Test it out with this suicidal little script (or should I say > scriptici

RE: What is my name

2003-10-30 Thread Dan Muey
> Hi, > > I have a little problem. I have script "test.pl" and inside > this script I want to know what is "my name" (I mean this "test.pl". > > test.pl script > --- > > my $this_scripts_name_is = who_am_I(); > > sub who_am_I > { > my $my_name = ; # what I have to put to this

Re: What is my name

2003-10-30 Thread Sudarshan Raghavan
[EMAIL PROTECTED] wrote: Hi, I have a little problem. I have script "test.pl" and inside this script I want to know what is "my name" (I mean this "test.pl". $0 will contain the program name perldoc perlvar -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PR