On Friday, August 2, 2002, at 05:32 , Chip Place wrote:
> Another interesting bit of information: > > If I invoke the script like this > > $ perl myperlscript > > I don't get the leading ./ or path > > does this make any sense? yes. it is the same as invoking a shell script with sh some_shell_script when you invoke an 'executable' from the command line - you either a) provide the fully qualified path, as you do with ./myScript b) hope that it is in the PATH "line" and hence it will be found 'fully qualified' what you might want to do is notice that the indirections to a perl script are relatively constant: mex.wetware.com: 70:] Iam /home/drieux/bin/Iam is In /home/drieux/bin - but Called from /.amd_mnt/gax/export/src/bsd/4.6/perl-5.6.1/lib mex.wetware.com: 71:] gax: 63:] ../bin/Iam .../bin/Iam is In ../bin - but Called from /export/home/drieux/perl gax: 64:] perl ../bin/Iam .../bin/Iam is In ../bin - but Called from /export/home/drieux/perl gax: 65:] gax: 67:] perl Iam Iam is In . - but Called from /export/home/drieux/bin gax: 68:] all driven by the same piece of code see below. so you will also notice that your 'presumption' that perl myScript holds 'truish' - ONLY when it is invoked in the same directory where the script is.... ciao drieux http://www.wetware.com/drieux/pbl/ -------------- gax: 65:] sed 's/^/### /' !$ sed 's/^/### /' ../bin/Iam ### #!/usr/bin/perl -w ### use strict; ### use File::Basename qw/dirname/; ### use Cwd; ### ### # Iam - a piece of code to help with who is where when invoked ### ### my $name = $0; ### my $dir = dirname $name; ### my $curdir= cwd; ### ### print $name . " is In $dir - but Called from $curdir \n"; ### ### # ### # what if the distributed single sign on solution is ### # squirrelly so that $HOME interprets one way, but ### # $curdir follows the actual path vice logical path ### # How ever would we know if they were the same? ### # ### ### my $home_i = (stat $ENV{HOME})[1]; ### my $cur_i = (stat $curdir)[1]; ### ### if( $home_i == $cur_i ) { ### my $there = ($ENV{HOME} eq $curdir ) ? $ENV{HOME} : ### " \n\t known as both $ENV{HOME} and $curdir"; ### print "we are home in our Home Directory - $there \n"; ### ### } ### exit(0); gax: 66:] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]