in reply to Re^4: FindBin works differently on Fedora Core 2? (replace)
in thread FindBin works differently on Fedora Core 2?
Sorry, I don't use FindBin (no one would ever guess that).
Once again we have an example of a feature that FindBin has but doesn't bother to export in a reusable manner (expanding symbolic links).
use File::Spec::Functions qw( rel2abs splitpath catpath ); my $RealBin = $0; for( $RealBin ) { $_ = readlink($_) while -l $_; $_ = catpath( (splitpath rel2abs($_))[0,1] ); }
or
use File::Spec::Functions qw( rel2abs ); use File::Basename qw( dirname ); my $RealBin = $0; $RealBin = readlink($RealBin) while -l $RealBin; $RealBin = dirname( rel2abs($RealBin) );
and evidence that File::Spec could use some additions (realpath, basename, dirname).
- tye
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: FindBin works differently on Fedora Core 2? (replace)
by PodMaster (Abbot) on Jun 08, 2004 at 17:01 UTC | |
by eserte (Deacon) on Jun 08, 2004 at 17:43 UTC | |
|
Re^6: FindBin works differently on Fedora Core 2? (replace)
by eserte (Deacon) on Jun 08, 2004 at 16:29 UTC | |
by Anonymous Monk on Jun 08, 2004 at 17:19 UTC | |
by eserte (Deacon) on Jun 08, 2004 at 17:33 UTC | |
by tye (Sage) on Jun 08, 2004 at 18:06 UTC |