develooper Front page | perl.perl5.porters | Postings from June 2022

Re: Pre-RFC: yield true feature

Thread Previous | Thread Next
From:
Yuki Kimoto
Date:
June 8, 2022 08:47
Subject:
Re: Pre-RFC: yield true feature
Message ID:
CAExogxNk-_yDi29x=-cs9F4bCnbadmgtgP=5dOikvHzXWmSX0w@mail.gmail.com
2022-6-8 0:56 Dan Book <grinnz@gmail.com> wrote:

> On Tue, Jun 7, 2022 at 5:06 AM Darren Duncan <darren@darrenduncan.net>
> wrote:
>
>> What would the effect of yield_true be on a Perl source file used as
>> simple
>> configuration data like the following, which I have actually practiced...
>>
>
> No effect. This is only for require (and thus use).
>
> -Dan
>

"yield_true" feature doesn't affect "do".

Does this mean "yield_true" is not simple syntax sugar at the end of "1"?

Does the following code work well?

  # Foo.pm
  use feature 'yield_true';

  undef

  # do - $ret is undef
  my $ret = do 'Foo.pm';

  # require - OK
  require 'Foo.pm';

Thread Previous | 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