Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: I think this would be a static in Perl 6?

by TheDamian (Priest)
on Apr 10, 2002 at 00:56 UTC ( #157909=note: print w/ replies, xml ) Need Help??


in reply to I think this would be a static in Perl 6?
in thread Static variables (and also Perl 6)

Yep. I believe that that works exactly as tilly suggested. Way cool. Wish I'd thought of it. Here's an interesting variant:

my ($static1, $static2) := *BEGIN{["val1","val2"]};
(Note the implicit enreferencing of the array reference returned by the BEGIN block, which happens because the "flattening *" expects an array.)


Comment on Re: I think this would be a static in Perl 6?
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (12)
As of 2015-07-03 11:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (51 votes), past polls