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

Re: Closure Over Scalar?

by stevieb (Canon)
on Feb 18, 2021 at 16:33 UTC ( [id://11128528]=note: print w/replies, xml ) Need Help??


in reply to Closure Over Scalar?

You can force initialization at compile time by wrapping the assignment in a BEGIN block:

my $FIXED_STRING; BEGIN { $FIXED_STRING = 'fixed_string'; } my %persistent;

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (3)
As of 2024-06-18 06:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    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.