XP is just a number | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Welp, I tried
and it works. It returns the exact same thing, in this one specific case, as plain $0. First, thanks for all the help! :-) Second, the decision. I have a bunch of scripts to convert. They will all be shared on a network drive and our team will run them over the network. I need the path so I can determine where the config files for the scripts are, on the fly, even if the whole set of scripts move to another location. This setup will let us always stay in-sync and share scripts, etc. Is it going to be worthwhile for me to put in the full-blown use File::Spec::Functions qw(rel2abs);, or can I get away with just $0? This is a judgement call, but I want your judgements! :-) Update: After some experimentation, I've decided to go with the following for finding the directory my scripts are running in. Thanks! ibanix $ echo '$0 & $0 &' > foo; chmod a+x foo; foo; In reply to Re: Re^3: Find the full path of the script at run time
by ibanix
|
|