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

Re: Pre-RFC: yield true feature

Thread Previous | Thread Next
From:
Darren Duncan
Date:
June 7, 2022 09:05
Subject:
Re: Pre-RFC: yield true feature
Message ID:
3b16ae65-80e4-7156-4331-f61f38cfa07f@darrenduncan.net
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...

Contents of file config.pl:

   use 5.38;  # includes yield_true
   my $config_rh = {...};  # last statement

Contents of program using it:

   ...
   my $config_rh = do 'config.pl';
   ...

Note that I wrote the above from memory of something I did a couple decades ago, 
it may not be correct, but should have the right idea.

The point is, if yield_true is in effect, would it break the above usage pattern 
and result in the main program $config_rh containing true rather than the 
intended hash ref of config data?

Or is yield_true intended to apply in more limited circumstances than all 
compiled Perl files?

-- Darren Duncan

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