Skip to content

Modules::RequireExplicitInclusion trips on structures in constant.pm #12

@xsawyerx

Description

@xsawyerx

If I set a construct with constant.pm, it will trip Modules::RequireExplicitInclusion. For example:

use constant {
    'FOO' => {},
};

use constant 'BAR' => [];

FOO->{'foo'} = 'bar';

BAR->[0] = 'baz';

Has the following failures:

[Modules::RequireExplicitInclusion] Use of "FOO" without including "FOO" at eg.pl line 7, near 'FOO->{'foo'} = 'bar';'
[Modules::RequireExplicitInclusion] Use of "BAR" without including "BAR" at eg.pl line 9, near 'BAR->[0] = 'baz';'

This is hard to detect, but maybe we need a configuration option that only flags methods and fuctions, rather than hash or array calls.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions