I am using the name of my Perl script to call in an associated INI file with
the same name.  Someone ran across something today that I have not seen
before.  The server (Win 2003) on which the script runs has .pl files to be
set with the Perl.exe as the default associated program.  When I run a
script, I always use the command "perl nameofscript.pl".  When someone was
testing a script for me today, they simply entered "nameofscript.pl".  It
caused a reaction that I don't understand. So I created a very simple script
to experiment.  Why does this give two different values, based on whether or
not "perl" is used before the script? 


#!/usr/local/bin/perl
use strict;
use warnings;
my $script_name = $0;
print "script name is $script_name\n";


C:\Scripts>perl pathtest.pl
script name is pathtest.pl

C:\Scripts>pathtest.pl
script name is C:\Scripts\pathtest.pl

C:\Scripts>

Thank you!
Tim


-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to