Hi rkillera,
The $^X variable (in the first reply) displays the first word of the command line you used to start this program. If you started this program by entering its name, the name of the program appears in $^X. If you used the perl command to start this program, $^X contains perl.
The following statement checks to see whether you started this program with the command perl:
if ($^X ne "perl") {
print ("You did not use the 'perl' command ");
print ("to start this program.\n");
}
So the first reply might not be so useful in your case.
I dont know which platform Your working with. But in unix i usually do this way.
$path = `which perl`;
print $path;
/usr/bin/perl
If you want to run perl script there is also another way. Put the perl interpreter path in the first line of your program. This is called shebang ling techinically
#!/usr/bin/perl
Run the program like this.
./pgm
This will run from the interpreter you have mentioned in the first line of the program.
-Prasanna.K
|