If you've a background in #C and #Perl and have thought about contributing to the Perl core, you know it's daunting hacking on the core of a language.
@leonerd is offering to help you learn.
nntp.perl.org/group/perl.perl5…
Also, he's written a tutorial on how to contribute a core feature: leonerds-code.blogspot.com/202…
Writing a Perl Core Feature
(Index) | < Prev | Next > One of the headline features that was added in Perl version 5.32.0 was the isa operator . This feature was writ...leonerds-code.blogspot.com
This entry was edited (1 year ago)
Mark Gardner reshared this.
Equinox Deschanel
in reply to Curtis "Ovid" Poe (he/him) • • •Paul Evans
in reply to Equinox Deschanel • • •Equinox Deschanel
in reply to Paul Evans • • •Equinox Deschanel
in reply to Paul Evans • • •I think I've got the right hook, let me know if this seems right.
mg.c has Perl_magic_get (line 883 of mg.c) to associate the magic with the variable by looking at the string in mg->mg_ptr (this names the magic).
So if I can set the mg_ptr to (say) $., then $ARBITRARY_VAR acts like $. does, because Perl_magic_get finds the appropriate magic.
If this was a greenfield project, I'd just change the sv_magic API to let me pass an optional extra parameter to set the mg_ptr, but that has a lot of knock-on issues all over the code that expects the API to work the way it does now, so the right thing is probably to have the English vars go to magicalize the way the "real" magic vars do now to set up magic as usual, and then override the mg_ptr with the proper string after.
Let me know if this looks sensible, or if I'm way off track. Thanks!
Füsilier Breitlinger
Unknown parent • • •Paul Evans
Unknown parent • • •Dan Sugalski
in reply to Curtis "Ovid" Poe (he/him) • • •