Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re^2: Perl6: S2 identifier and $ special var questions

by rir (Vicar)
on Sep 14, 2011 at 17:26 UTC ( #925951=note: print w/replies, xml ) Need Help??


in reply to Re: Perl6: S2 identifier and $ special var questions
in thread Perl6: S2 identifier and $ special var questions

Thanks, the code is explained.

How would I declare and use $MyClass::-O'malley's as indicated by the quoted spec?

Be well,
rir

Replies are listed 'Best First'.
Re^3: Perl6: S2 identifier and $ special var questions
by TimToady (Parson) on Sep 14, 2011 at 18:19 UTC
    You may not start an identifier with - like that; hyphens and apostrophes are only allowed internally.

    In theory one can declare or use any name you like using Perl 6's explicit symbolic ref notation:

    my $::("-O'Malley's") = 42; say $::("-O'Malley's");
    However, neither implementation does constant folding well enough yet to recognize these as a static variable names.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://925951]
help
Chatterbox?
[usemodperl]: someone has yet to make that future famous free http to https proxy written in perl and supported by ads, paypal, patreon, etc to make millions of dollars a minute!
[Veltro]: Why would this be fresh, I recon this is stuff that happens all the time (not Perl per se)
[Corion]: usemodperl: I'm sure you could even code that on the command line.
[usemodperl]: definitely

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (8)
As of 2018-06-24 17:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?



    Results (126 votes). Check out past polls.

    Notices?