Get the location of the perl script

Please support our Perl advertiser: Programming Forums - DaniWeb Sister Site
Thread Solved

Join Date: Jun 2005
Posts: 1,496
Reputation: WolfPack has a spectacular aura about WolfPack has a spectacular aura about WolfPack has a spectacular aura about 
Solved Threads: 104
Moderator
WolfPack's Avatar
WolfPack WolfPack is offline Offline
Mentally Challenged Mod.

Get the location of the perl script

 
0
  #1
Feb 14th, 2007
Does any of you know how to get the pathname of the perl script that is being executed?

Say it is located in /home/wolfpack/perl/
I run it from /home/wolfpack by giving the absolute path name like,

/home/wolfpack/perl/scriptname [arguments]

I want to get the path /home/wolfpack/perl so that I can use some files inside that directory so that perl does not search for them inside the current working directory which is /home/wolfpack/
バルサミコ酢やっぱいらへんで
Reply With Quote Quick reply to this message  
Join Date: Jun 2005
Posts: 1,496
Reputation: WolfPack has a spectacular aura about WolfPack has a spectacular aura about WolfPack has a spectacular aura about 
Solved Threads: 104
Moderator
WolfPack's Avatar
WolfPack WolfPack is offline Offline
Mentally Challenged Mod.

Re: Get the location of the perl script

 
0
  #2
Feb 14th, 2007
I just read about $0 in the Llama book. I think I can do something with it.
バルサミコ酢やっぱいらへんで
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



Tag cloud for Perl
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC