--- Ovid <[EMAIL PROTECTED]> wrote:
> $ENV{PATH} = do {
> my $sep = $Config{path_sep};
>
> join $sep, (
> map { /(.*)/ }
> grep { stat($_) && !( stat($_)->mode & S_IWOTH ) }
> grep { file_name_is_absolute($_) }
> split( /\Q$sep/, $ENV{PATH} ),
> );
> };
Ugh. I hated my double call to stat().
$ENV{PATH} = do {
my $sep = $Config{path_sep};
join $sep, (
map { /(.*)/ }
grep {
local $_ = stat $_;
defined && !( $_->mode & S_IWOTH )
}
grep { file_name_is_absolute($_) }
split( /\Q$sep/, $ENV{PATH}, -1 ),
);
};
Cheers,
Ovid
--
Buy the book -- http://www.oreilly.com/catalog/perlhks/
Perl and CGI -- http://users.easystreet.com/ovid/cgi_course/