Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Private variable in class method does not go out of scope

by Anonymous Monk
on Jul 09, 2024 at 11:53 UTC ( [id://11160469]=note: print w/replies, xml ) Need Help??


in reply to Private variable in class method does not go out of scope

    my $data = shift if (@_);
    
    am I missing something??
A couple things:

Why type those () around @_?

Since that shift refers to @_ and returns undef if @_ is empty why ask about @_?

  • Comment on Re: Private variable in class method does not go out of scope

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11160469]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (6)
As of 2024-09-18 11:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    The PerlMonks site front end has:





    Results (24 votes). Check out past polls.

    Notices?
    erzuuli‥ 🛈The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.