Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

\(my $var) is not an unused variable (RT 82411) #55

Open
jkeenan opened this issue Sep 12, 2024 · 0 comments
Open

\(my $var) is not an unused variable (RT 82411) #55

jkeenan opened this issue Sep 12, 2024 · 0 comments
Labels

Comments

@jkeenan
Copy link
Collaborator

jkeenan commented Sep 12, 2024

Transferred from rt.cpan.org ...

Original Ticket Information

Original Text

When a reference to a variable is used it should not be considered unused.

There is a common idiom when declaring an empty object which internal
representation is a scalar:

    bless do { \(my $x) }, $class

or

    bless \(my $y), $class

Currently $x is reported as unused, while it is.

Follow-up Report (same date as original)

Workaround:

do { my $x; bless \($x), $class }
@jkeenan jkeenan added the Bug label Sep 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

1 participant