this POD is either confusing or plain wrong
Beginning in v5.26.0, the referencing operator can come after my, state, our, or local. This syntax must be enabled with use feature 'declared_refs' . It is experimental, and will warn by default unless no warnings experimental::refaliasing is in effect.
In reality is the warning disabled with no warnings 'experimental::declared_refs';
the experimental::refaliasing warning belongs to https://perldoc.perl.org/perlref#Assigning-to-References
use Data::Dump qw/pp dd/;
use feature qw(
no warnings 'experimental::refaliasing';
my $a = ;
\@a = $a;
no warnings 'experimental::declared_refs';
my \@arr = ;
C:/Strawberry/perl/bin\perl.exe -w d:/tmp/pm/auto_ref.pl
Compilation finished at Sat Oct 16 14:45:33
NB: that use feature qw(declared_refs) doesn't seem to make sense without the other feature.
my \@arr; without assignment will create a new warning "Useless use of single ref constructor in void context"
Are you posting in the right place? Check out Where do I post X? to know for sure.
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
Want more info? How to link or
or How to display code and escape characters
are good places to start.