Packages / openSUSE Tumbleweed / Source / perl-Perl-Critic-Policy-Plicease-ProhibitArrayAssignAref

Source Package: perl-Perl-Critic-Policy-Plicease-ProhibitArrayAssignAref (100.0.0-1.6)

Don't assign an anonymous arrayref to an array

This policy is a fork of Perl::Critic::Policy::ValuesAndExpressions::ProhibitArrayAssignAref. It differs from the original by not having a dependency on List::MoreUtils. It is unfortunately still licensed as GPL3. It asks you not to assign an anonymous arrayref to an array @array = [ 1, 2, 3 ]; # bad The idea is that it's rather unclear whether an arrayref is intended, or might have meant to be a list like @array = ( 1, 2, 3 ); This policy is under the "bugs" theme (see Perl::Critic/POLICY THEMES) for the chance '[]' is a mistake, and since even if it's correct it will likely make anyone reading it wonder. A single arrayref can still be assigned to an array, but with parens to make it clear, @array = ( [1,2,3] ); # ok Dereferences or array and hash slices (see perldata/Slices) are recognised as an array target and treated similarly, @$ref = [1,2,3]; # bad assign to deref @{$ref} = [1,2,3]; # bad assign to deref @x[1,2,3] = ['a','b','c']; # bad assign to array slice @x{'a','b'} = [1,2]; # bad assign to hash slice

Package information

Homepage
[https://metacpan.org/release/Perl-Critic-Policy-Plicease-ProhibitArrayAssignAref]
License
GPL-1.0-or-later
Downstream package maintainer
Unknown: not reported in the indexed source

The following binary packages are built from this source package:

Known vulnerabilities

No matching advisories in the tracked sources.

Last synced:

[CVE catalog]

Sources

  • Authoritative source; repository metadata signature verified

    Signature evidence

    tumbleweed-oss-multiarch:4db10cdde3ad82c7e22be35753c9e164b4bdd30f92db4aee17a0d4c94c5f902f

    Repository-signature verification record
    Signed-object SHA-256
    4db10cdde3ad82c7e22be35753c9e164b4bdd30f92db4aee17a0d4c94c5f902f
    Signer fingerprint
    AD485664E901B867051AB15F35A2F86E29B700A4
    Keyring revision
    opensuse-project-signing-key.asc
    SHA-256 b5745739ebfb95b25b8e810f9bcb847fe750ccda598bd85f02f0e974599a6d7e
    Tool and policy
    gpgv (GnuPG) 2.4.9
    openfactory-software-catalog-signature-v1
    Verification time
    Sep 1, 2026
    Repository metadata hash linkage
    Result
    Recorded as verified; digest details unavailable