At 01:26 AM 9/10/00 -0400, Chaim Frenkel wrote:
>Would returning the array of status be sufficient?
>
> @foo = chmod 755, "bar", "baz", "quux";
> # @foo == (0, 2, 0);
>
>How to convert them to error messages would be a challenge.
>Unless passing them through $! would do the trick.
>
>Hmm, perl -wle '$!=3; print $!'
>No such process
>
>Yup, works.
But you still can't say @foo = chmod 755, "bar", "baz", "quux" or die ...
because the function will now always return true in a list context. This
is only slightly better than returning false iff the function failed.
><chaim>
>
> >>>>> "PS" == Peter Scott <[EMAIL PROTECTED]> writes:
>
>PS> 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.
>
>PS> where PerlLIO_chmod is defined as chmod on most righteous systems. So it
>PS> would be a matter of squirreling away the errno for each bad result.
>
>PS> I just can't get over the result in the successful case being an empty
>PS> list, though. And conversely. Maybe this isn't itching enough to be
>worth
>PS> scratching this hard, but it seemed like a good direction :-( Anyone got
>PS> any brilliant ideas before I withdraw it?
>
>--
>Chaim Frenkel Nonlinear Knowledge, Inc.
>[EMAIL PROTECTED]
>+1-718-236-0183
--
Peter Scott
Pacific Systems Design Technologies