develooper Front page | perl.perl5.porters | Postings from February 2003

File operators don't dwim

Thread Next
From:
=?iso-8859-1?Q?St=E9phane?= Payrard
Date:
February 11, 2003 21:57
Subject:
File operators don't dwim
Message ID:
20030212055654.GQ2873@stefp.dyndns.org
I was so sure that, in case of success, the file operators would return
the filename that I wrote the following code to print where are the
perl interpretors in the PATH.
But, in case of success, fileops returns 1 not the filename.

local $, = '\n";
sub mapgrep (&@)  { my ($fun, @args)=@_;   map {  &{$fun}($_) } grep {   &{$fun}($_) } @args }
print (mapgrep {  -x  "$_/perl"  } split /:/, $ENV{PATH}), "\n";

Is there a reason why file operators don't dwim?

--
 stef

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About