Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re^3: Recap: The Future of Perl 5

by tobyink (Canon)
on Aug 24, 2018 at 11:40 UTC ( [id://1221018]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Recap: The Future of Perl 5
in thread Recap: The Future of Perl 5

Hmm, interesting. Do you know how much of that is in the core Perl (as Ovid is using the term "core"… perl.exe itself, no modules), and how much is done by fields.pm and friends?

If it's mostly done by the modules, then I don't see a problem with there being multiple ways of hooking into my Foo $x. TIMTOWTDI after all.

Replies are listed 'Best First'.
Re^4: Recap: The Future of Perl 5
by dave_the_m (Monsignor) on Aug 24, 2018 at 12:09 UTC
    It's built into the perl executable itself:
    BEGIN { %Foo::FIELDS = qw(a 1 b 1) }; my Foo $x = {}; $x->{c} = 1; # compile-time error
    fields.pm just populates the field hash

    Dave.

      Interesting. I guess this explains the limitation with Lexical::Types where it allows you to define, say, my Str $x to do something else other than check $x is a blessed Str object (and I've started to explore that possibility using Lexical::TypeTiny), but still requires there to be a Str package defined. I guess Perl needs that package to exist so that it can look for %FIELDS.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (4)
As of 2024-04-19 05:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found