Venkata Reddy Chappavarapu wrote: > Hi, > > I am wondering is there a way to get the absolute path for a given > file in perl? > > > > My requirement is as follows: > > 1) I have a driver script like ~/testing/test_driver.pl. > > 2) Inside the driver script I need to run all the scripts > ~/testing/testsrc/*.pl. > > 3) So, if I know the absolute path of the driver script I can go to > the testsrc directory relative to that and I can do a ‘ls’ to get all > the scripts. > > 4) So that I can run the driver script irrespective of the > directory. Ex: ../../../testing/test_driver.pl
# to find the path to the script you are executing: use FindBin qw($RealScript $RealDir); print "$RealDir/$RealScript\n"; -- ,-/- __ _ _ $Bill Luebkert Mailto:[EMAIL PROTECTED] (_/ / ) // // DBE Collectibles Mailto:[EMAIL PROTECTED] / ) /--< o // // Castle of Medieval Myth & Magic http://www.todbe.com/ -/-' /___/_<_</_</_ http://dbecoll.tripod.com/ (My Perl/Lakers stuff) _______________________________________________ Perl-Unix-Users mailing list Perl-Unix-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs