At 06:40 AM 8/30/00 -0600, Tom Christiansen wrote:
> >>My worry is that it seems like this would return
> >>an empty list on success, so:
> >>
> >>         @foo = chmod 755, "bar", "baz", "quux"
> >>                 or die "Whoops, died on success!";
> >>
> >>
> >>This seems to me to go contrary to the way perl tends to work... are
> >>there any other functions (beside system) that do this?  Am I
> >>misunderstanding this?
>
> >No, you've hit on the biggest flaw of the RFC.  I am less enamored of it
> >now than I once was.  I'd still like to get those individual failure
> >reasons but I am beginning to think it is not worth the cost.  Anyone got a
> >brainwave on how to have the cake and eat it too?
>
>I'm also concerned about all the separate errnos for each of those failures.

Me too, which is why RFC 52 says


=head2 Hash Context

When the result is assigned to a hash, the list returned could be the names
of the unsuccessfully modified files and their corresponding C<$!> errors.


Currently these functions look like this internally:

                 if (PerlLIO_chmod(name, val))
                     tot--;

where PerlLIO_chmod is defined as chmod on most righteous systems.  So it 
would be a matter of squirreling away the errno for each bad result.

I just can't get over the result in the successful case being an empty 
list, though.  And conversely.  Maybe this isn't itching enough to be worth 
scratching this hard, but it seemed like a good direction :-(  Anyone got 
any brilliant ideas before I withdraw it?
--
Peter Scott
Pacific Systems Design Technologies

Reply via email to