In case you were wondering, it turned out I had /usr/bin in my PATH twice :-(
#!/usr/bin/perl -w use strict; my %locations; foreach my $path (split(/:/,$ENV{PATH})) { opendir(DIR,$path) || die "Directory $path in your PATH can not be opened:$!\n"; foreach my $file (readdir(DIR)) { next if -d "$path/$file"; # not sure if this is really needed... next unless -x _; push (@{$locations{$file}},$path); } } foreach my $file (sort keys %locations) { print "$file :",join(" ",@{$locations{$file}}),"\n" if scalar($#{$locations{$file}}); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
•Re: Conflicts in my PATH
by merlyn (Sage) on Mar 05, 2004 at 23:27 UTC | |
by matija (Priest) on Mar 06, 2004 at 07:12 UTC | |
|
use Env qw( @PATH );
by PodMaster (Abbot) on Mar 05, 2004 at 22:06 UTC | |
|
Re: Conflicts in my PATH
by ambrus (Abbot) on Mar 06, 2004 at 19:39 UTC |