John
p.s. I used 'diff -p' because someone said it was helpful to see the function
that is being patched. Is it???
--
John Peacock
Director of Information Research and Technology
Rowman & Littlefield Publishing Group
4720 Boston Way
Lanham, MD 20706
301-459-3366 x.5010
fax 301-429-5747
--- perl.test/dump.c.orig Tue Jun 18 16:26:48 2002
+++ perl.test/dump.c Thu Aug 8 18:00:48 2002
@@ -770,6 +770,7 @@ static struct { char type; char *name; }
{ PERL_MAGIC_taint, "taint(t)" },
{ PERL_MAGIC_uvar_elem, "uvar_elem(v)" },
{ PERL_MAGIC_vec, "vec(v)" },
+
{ PERL_MAGIC_vstring, "v-string(V)" },
{ PERL_MAGIC_substr, "substr(x)" },
{ PERL_MAGIC_defelem, "defelem(y)" },
{ PERL_MAGIC_ext, "ext(~)" },
--- perl.test/perl.h.orig Thu Jun 20 09:30:34 2002
+++ perl.test/perl.h Thu Aug 8 17:47:07 2002
@@ -2602,6 +2602,7 @@ Gid_t getegid (void);
#define PERL_MAGIC_uvar 'U' /* Available for use by extensions */
#define PERL_MAGIC_uvar_elem 'u' /* Reserved for use by extensions */
#define PERL_MAGIC_vec 'v' /* vec() lvalue */
+#define PERL_MAGIC_vstring 'V' /* SV was vstring literal */
#define PERL_MAGIC_substr 'x' /* substr() lvalue */
#define PERL_MAGIC_defelem 'y' /* Shadow "foreach" iterator variable /
smart parameter vivification */
--- perl.test/sv.c.orig Wed Jul 17 18:52:14 2002
+++ perl.test/sv.c Sat Aug 10 15:09:46 2002
@@ -3947,6 +3947,11 @@ Perl_sv_setsv_flags(pTHX_ SV *dstr, regi
SvIsUV_on(dstr);
SvIVX(dstr) = SvIVX(sstr);
}
+
if ( SvVOK(sstr) ) {
+
MAGIC *mg = SvMAGIC(sstr);
+
sv_magicext(dstr,NULL,PERL_MAGIC_vstring,NULL,mg->mg_ptr,mg->mg_len);
+
SvRMAGICAL_on(dstr);
+
}
}
else if (sflags & SVp_IOK) {
if (sflags & SVf_IOK)
--- perl.test/sv.h.orig Sun Jun 9 20:26:54 2002
+++ perl.test/sv.h Thu Aug 8 20:15:25 2002
@@ -577,6 +577,7 @@ Set the length of the string which is in
#define SvIOK_notUV(sv) ((SvFLAGS(sv) & (SVf_IOK|SVf_IVisUV)) \
== SVf_IOK)
+#define SvVOK(sv) (SvMAGICAL(sv) && mg_find(sv,'V'))
#define SvIsUV(sv) (SvFLAGS(sv) & SVf_IVisUV)
#define SvIsUV_on(sv) (SvFLAGS(sv) |= SVf_IVisUV)
#define SvIsUV_off(sv) (SvFLAGS(sv) &= ~SVf_IVisUV)
--- perl.test/util.c.orig Thu Jul 18 15:28:10 2002
+++ perl.test/util.c Sat Aug 10 09:08:22 2002
@@ -4063,6 +4063,7 @@ char *
Perl_new_vstring(pTHX_ char *s, SV *sv)
{
char *pos = s;
+ char *start = s;
if (*pos == 'v') pos++; /* get past 'v' */
while (isDIGIT(*pos) || *pos == '_')
pos++;
@@ -4081,11 +4082,10 @@ Perl_new_vstring(pTHX_ char *s, SV *sv)
/* this is atoi() that tolerates underscores */
char *end = pos;
UV mult = 1;
-
if ( s > pos && *(s-1) == '_') {
-
mult = 10;
-
}
while (--end >= s) {
UV orev;
+
if (*end == '_' )
+
continue;
orev = rev;
rev += (*end - '0') * mult;
mult *= 10;
@@ -4103,17 +4103,18 @@ Perl_new_vstring(pTHX_ char *s, SV *sv)
sv_catpvn(sv, (const char*)tmpbuf, tmpend - tmpbuf);
if (!UNI_IS_INVARIANT(NATIVE_TO_UNI(rev)))
SvUTF8_on(sv);
-
if ( (*pos == '.' || *pos == '_') && isDIGIT(pos[1]))
+
if ( *pos == '.' && isDIGIT(pos[1]) )
s = ++pos;
else {
s = pos;
break;
}
-
while (isDIGIT(*pos) )
+
while ( isDIGIT(*pos) || *pos == '_' )
pos++;
}
SvPOK_on(sv);
-
SvREADONLY_on(sv);
+
sv_magicext(sv,NULL,PERL_MAGIC_vstring,NULL,(const char*)start, pos-start);
+
SvRMAGICAL_on(sv);
}
return s;
}
--- perl.test/pod/perlguts.pod.orig Thu Jun 6 09:43:52 2002
+++ perl.test/pod/perlguts.pod Sat Aug 10 15:30:20 2002
@@ -963,6 +963,7 @@ The current kinds of Magic Virtual Table
t PERL_MAGIC_taint vtbl_taint Taintedness
U PERL_MAGIC_uvar vtbl_uvar Available for use by extensions
v PERL_MAGIC_vec vtbl_vec vec() lvalue
+ V PERL_MAGIC_vstring (none) v-string scalars
x PERL_MAGIC_substr vtbl_substr substr() lvalue
y PERL_MAGIC_defelem vtbl_defelem Shadow "foreach" iterator
variable / smart parameter
@@ -974,10 +975,10 @@ The current kinds of Magic Virtual Table
~ PERL_MAGIC_ext (none) Available for use by extensions
When an uppercase and lowercase letter both exist in the table, then the
-uppercase letter is used to represent some kind of composite type (a list
-or a hash), and the lowercase letter is used to represent an element of
-that composite type. Some internals code makes use of this case
-relationship.
+uppercase letter is typically used to represent some kind of composite type
+(a list or a hash), and the lowercase letter is used to represent an element
+of that composite type. Some internals code makes use of this case
+relationship. However, 'v' and 'V' (vec and v-string) are in no way related.
The C<PERL_MAGIC_ext> and C<PERL_MAGIC_uvar> magic types are defined
specifically for use by extensions and will not be used by perl itself.
Moin,
>Patch after sig is a combination of my previous two patches with a
>significant bug fix in sv_setsv_flags as well as a little bit of
>documentation in perlguts.pod.
>
>John
>
>p.s. I used 'diff -p' because someone said it was helpful to see the
>function that is being patched. Is it???
I have a lot of indentical code in BigInt/BigFloat (smells of Copy&Paste)
and I think it would be helpfull there. But I don't know, who said that? :)
Best wishes,
Tels
- --
perl -MDev::Bollocks -e'print Dev::Bollocks->rand(),"\n"'
autoschediastically incubate network schemas
http://bloodgate.com/perl My current Perl projects
PGP key available on http://bloodgate.com/tels.asc or via email
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: When cryptography is outlawed, bayl bhgynjf jvyy unir cevinpl.
iQEVAwUBPVWEzHcLPEOTuEwVAQH9Awf/Qpq0HkRnTmtkeRG0/FXYdISeqG7ZEi3I
pJmh2LkZApPWsVvxNbYxi3geMVSSeVRv/RviNbeTaW2OZSl09mjbd0icBAcVbwDj
p8KQLIDPOjtAD4WgQzL/4+t+8HlDKmj6wHzO7GWSThWhb9R9lM0EqZlkEJmzRjCM
UppK43Sy4ASU7+JzgrFs9llVFyJpFWAA8QcW8HhZPhPY5wkOJ76RyIDXBBN7H/RB
CiiZmrtf0BPEoy4wPC69cTn18BTfajqaSKrrH1n+F/CDG9aYlBkh6PFLMM7o2hPd
z9i7yRdat7QKxnSm4NeBfeymZoRfgE8DGy99wsFCK/u8TLupeINrrw==
=X2VE
-----END PGP SIGNATURE-----
Yes.
Comments anyone??? I'd still like to find a way to determine at the level of
pure Perl code whether a scalar contains a v-string (which is why I am poking
around inside ref() right now ;~).
I'm having a serious case of Warnock's Dilemma...
John
This doesn't look right: the patch appears to have been wrapped in
such a way that it appears almost all the patched lines are blank.
Please could you resubmit?
:p.s. I used 'diff -p' because someone said it was helpful to see the function
:that is being patched. Is it???
Yes, when what's being patched is a C function, or occasionally a
perl subroutine. Your patch shows up nicely both the things it does
well and those it doesn't.
Hugo
Stupid, stupid Mozilla mailer!
Attached this time...
Thanks, applied as #17742.
Could we get some tests added for these changes?
Hugo
Until I can figure out how to expose the fact that v-strings are magical at the
Perl level, there is no possible test. The reason being is that this change
must, by design, be completely transparent for all existing v-string operations.
It also has no additional functionality until someone writes XS code to use it
(like my version object patch ;~).
OK, I guess I could test that "v.1.2_3" parses as \1\23 (which is the way it
should have done all the time). Expect something tomorrow...
> h...@crypt.org wrote:
> > Could we get some tests added for these changes?
> Until I can figure out how to expose the fact that v-strings are magical at the
> Perl level, there is no possible test.
Does Devel::Peek show the special magic on the scalars? Not sure how it
sees things like Magic and stuff, also not sure about the viability of a
test depending on Devel::Peek.
R.
Yes, but I share your concerns about using it for the test.
$ ./perl -Ilib -MDevel::Peek
$v = 1.2.3;
Dump $v;
__END__
SV = PVMG(0x81961e0) at 0x8179980
REFCNT = 1
FLAGS = (POK,pPOK)
IV = 0
NV = 0
PV = 0x8174f58 "\1\2\3"\0
CUR = 3
LEN = 4
MAGIC = 0x8176268
MG_VIRTUAL = 0
MG_TYPE = PERL_MAGIC_v-string(V)
MG_LEN = 5
MG_PTR = 0x81980f8 "1.2.3"
I would _like_ this to happen:
$ ./perl
$v = 1.2.3;
print ref \$v;
__END__
VSTRING
but I'm sure someone will complain about that... ;~)
I've attached a small WinCE-related patch that should:
- make USE_PERLIO to be default, which is good, because fileIO on WinCE is
rather weak, and perlio layer is really helpful.
- wince/win32io.c correction is trying to be in sync with win32/win32io.c,
otherwise compiler do not let us go further.
- few bits into wince/wince.c to go further instead of croaking.
Unfortunately Errno extension now failed to be built due to some MakeMaker
changes (probably), I'll try finding more details later.
Proposed patch was prepared for 5.8.0 but should fit for latest perl as
well, because there were no changes into that directory recently.
Being in that directory, I found a file ./wince/splittree.pl which I do not
see referenced from anywhere. I'm going to propose a deletion of it, but a
same question arise for win32/ directory: who use a file
../win32/splittree.pl. I see it useless and propose its deletion. Does anyone
has something to say to protect that file?
Warmest wishes,
Vadim.
Here is another piece of the original patch that got missed (arrggghhhhh) as
well as a patch to identify v-strings from perl code via ref() and some tests to
see that it is working.
I'm very dubious about the ref() patch, but it's in for now as #17747.
There are many components of perl that need to handle arbitrary data:
Devel::Peek seems happy, but Data::Dumper and Storable appear to see only
the stringification, and I'm sure there are others I haven't thought of
yet. Let's see what problems that causes.
I get a test failure on ext/B/t/stash.t; I can't tell, because there are
no comments, but I'd guess this is testing that the B:: modules can
accurately determine which modules should be ignored for compilation
because they are involved in the B:: process rather than the 'real' code.
I've added 'version' to the expected list for now, but please check
whether it is the code that should change instead.
Hugo
Thanks. I am certainly open to some other way to test whether a given scalar
contains a vstring; ref() just seemed the easiest way to do it.
>
> I get a test failure on ext/B/t/stash.t;
My reading is of the stash.t test was just that it was making sure that it could
find all the system-defined stashes that it expected to find. Adding version to
the list was the correct response.
Thanks, applied as #17769.
: DllExport int
: win32_dup(int fd)
: {
:- Perl_croak(aTHX_ PL_no_func, "dup");
:- return -1;
:+ //vv Perl_croak(aTHX_ PL_no_func, "dup");
:+ return xcedup(fd); // from celib/ceio.c; requires some more work on it.
: }
I general, please try to avoid C++ style comments - even if the WinCE
compiler accepts them, it makes things unnecessarily more difficult
when other people want to copy the ideas.
Hugo
I'm very dubious about the ref() patch as well.
There's no need to test if a given scalar contains a vstring other
than by testing that it *behaves* like a vstring. vstrings provide
specific functionality, the tests should simply test for that functionality.
Just testing SvVOK doesn't actually tell you much. (And if you
really want to do that then the B::* modules provide a way.)
Tim.
I have to disagree. There is no behavior of vstrings that can be tested for,
since a vstring behaves exactly like any other PV-containing scalar, in fact my
patch was required to maintain that behavior. For example:
$ ./perl -Ilib -MDevel::Peek
$v1 = "1.0";
$v2 = v49.46.48;
Dump $v1;
Dump $v2;
__END__
SV = PV(0x816ed70) at 0x817d20c
REFCNT = 1
FLAGS = (POK,pPOK)
PV = 0x8175438 "1.0"\0
CUR = 3
LEN = 4
SV = PVMG(0x8197b28) at 0x817d218
REFCNT = 1
FLAGS = (RMG,POK,pPOK)
IV = 0
NV = 0
PV = 0x817f180 "1.0"\0
CUR = 3
LEN = 4
MAGIC = 0x8176748
MG_VIRTUAL = 0
MG_TYPE = PERL_MAGIC_v-string(V)
MG_LEN = 9
MG_PTR = 0x817f370 "v49.46.48"
The PV's are in every way identical and there is no way (prior to my patches) to
tell the two $v's apart.
>
> Just testing SvVOK doesn't actually tell you much. (And if you
> really want to do that then the B::* modules provide a way.)
SvVOK exposes the fact that scalar $v2 is a) magical and b) has 'V' magic. That
is the only way to tell that the scalar was processed by the scan_vstring()
code. If there is a better way to expose SvVOK to Perl code, I am open to the
suggestions.
Why does a v-string have magic then?
Whatever functionality is provided by the magic is what should be checked for.
That way you're not just checking that the magic exists, but that it works.
Umm, I've just realised that we're possibly talking at cross-purposes.
I was figuring that the ref($v) eq 'VSTRING' was _just_ to test SvVOK was
set as you expected it to be (for which using ref() is certainly overkill).
But maybe you see a need to applications to check if a value is a
v-string, which is a whole different issues (for which using ref()
is quite probably still overkill). Where's the need?
> > Just testing SvVOK doesn't actually tell you much. (And if you
> > really want to do that then the B::* modules provide a way.)
>
> SvVOK exposes the fact that scalar $v2 is a) magical and b) has 'V' magic. That
> is the only way to tell that the scalar was processed by the scan_vstring()
> code. If there is a better way to expose SvVOK to Perl code, I am open to the
> suggestions.
If there's really a need for applications to tell is a value is a
v-string then perhaps something could be added to Scalar::Util.
That would seem both more appropriate and much safer than adding
a new result to ref().
Tim.
The magic doesn't _do_ anything, it's just there to flag that it is a vstring.
It's a waste of magic, but since nothing is likely to ever be a composite type
of vec(), there seems to be little reason not to use it. The issue is that we
are out of flag bits to denote that something is a vstring; this was my last
gasp effort to make my version object code possible.
>
> Umm, I've just realised that we're possibly talking at cross-purposes.
> I was figuring that the ref($v) eq 'VSTRING' was _just_ to test SvVOK was
> set as you expected it to be (for which using ref() is certainly overkill).
>
> But maybe you see a need to applications to check if a value is a
> v-string, which is a whole different issues (for which using ref()
> is quite probably still overkill). Where's the need?
The need is that people have long complained that you never know whether you
have to use "%vd" or "%s". This is one of the key complaints about vstrings.
> If there's really a need for applications to tell is a value is a
> v-string then perhaps something could be added to Scalar::Util.
> That would seem both more appropriate and much safer than adding
> a new result to ref().
Patches welcome? Seriously, I just wanted to find some way to expose the fact
that a scalar had been processed by the vstring code. Since Scalar::Util is in
the core, we can certainly pester Graham to add a way of testing for vstrings.
How "deep" is Scalar::Util ?
How about inventing a generic has_magic() and then using that?
has_magic('V')
>
>John
--
Nick Ing-Simmons
http://www.ni-s.u-net.com/
Of course, you could do :
$ bleadperl -MB -wle 'print B::svref_2object(\v1.2)->MAGIC->TYPE'
V
but the has_magic($type) thing would have to walk through the chain
of magic. Not sure whether this is appropriate for Scalar::Util.
(But this could fit in B::Utils or another B:: helper module.)
XS code could call existing APIs for that - something like:
void
has_magic(SV *sv,char *type)
{
if (!SvMAGICAL(sv))
XSRETURNUNDEF;
if (mg_find(sv,*type))
XRETURNYES;
XSRETURNNO;
}
>Not sure whether this is appropriate for Scalar::Util.
Neither am I.
>(But this could fit in B::Utils or another B:: helper module.)
Or Internals or ...
IMO, its not. It opens up too much implementation detail for the
casual programmer who just wants to know if a scalar is a v-string.
If the v-string implementation changes, then all scripts that use
this would break. For Scalar::Util I would prefer the isvstring()
approach, which would match the approach taken for isweak()
Graham.
Yeap, just like that. Thanks.
Tim.
> John
>
> --
> John Peacock
> Director of Information Research and Technology
> Rowman & Littlefield Publishing Group
> 4720 Boston Way
> Lanham, MD 20706
> 301-459-3366 x.5010
> fax 301-429-5747
> --- perl-current.test/ext/List/Util/Util.xs.orig Sun Jan 13 15:23:28 2002
> +++ perl-current.test/ext/List/Util/Util.xs Wed Sep 11 21:23:58 2002
> @@ -417,6 +417,14 @@ CODE:
> OUTPUT:
> RETVAL
>
> +void
> +isvstring(sv)
> + SV *sv
> +PROTOTYPE: $
> +CODE:
> + ST(0) = boolSV(SvVOK(sv));
> + XSRETURN(1);
> +
> BOOT:
> {
> #ifndef SvWEAKREF
> --- perl-current.test/ext/List/Util/lib/Scalar/Util.pm.orig Mon Mar 18 06:16:07 2002
> +++ perl-current.test/ext/List/Util/lib/Scalar/Util.pm Wed Sep 11 21:20:37 2002
> @@ -10,7 +10,7 @@ require Exporter;
> require List::Util; # List::Util loads the XS
>
> our @ISA = qw(Exporter);
> -our @EXPORT_OK = qw(blessed dualvar reftype weaken isweak tainted readonly openhandle);
> +our @EXPORT_OK = qw(blessed dualvar reftype weaken isweak isvstring tainted readonly openhandle);
> our $VERSION = $List::Util::VERSION;
>
> sub openhandle ($) {
> @@ -41,7 +41,7 @@ Scalar::Util - A selection of general-ut
>
> =head1 SYNOPSIS
>
> - use Scalar::Util qw(blessed dualvar isweak readonly reftype tainted weaken);
> + use Scalar::Util qw(blessed dualvar isweak isvstring readonly reftype tainted weaken);
>
> =head1 DESCRIPTION
>
> @@ -87,6 +87,14 @@ If EXPR is a scalar which is a weak refe
> weaken($ref);
> $weak = isweak($ref); # true
>
> +=item isvstring EXPR
> +
> +If EXPR is a scalar which was coded as a vstring the result is true.
> +
> + $vs = v49.46.48;
> + $fmt = isvstring($vs) ? "%vd" : "%s"; #true
> + printf($fmt,$vs);
> +
> =item openhandle FH
>
> Returns FH if FH may be used as a filehandle and is open, or FH is a tied
> --- /dev/null Wed Dec 31 19:00:00 1969
> +++ perl-current.test/ext/List/Util/t/isvstring.t Wed Sep 11 21:36:17 2002
> @@ -0,0 +1,35 @@
> +#!./perl
> +
> +BEGIN {
> + unless (-d 'blib') {
> + chdir 't' if -d 't';
> + @INC = '../lib';
> + require Config; import Config;
> + keys %Config; # Silence warning
> + if ($Config{extensions} !~ /\bList\/Util\b/) {
> + print "1..0 # Skip: List::Util was not built\n";
> + exit 0;
> + }
> + }
> +}
> +
> +
> +use Scalar::Util qw(isvstring);
> +
> +print "1..4\n";
> +
> +print "ok 1\n";
> +
> +$vs = 49.46.48;
> +
> +print "not " unless $vs == "1.0";
> +print "ok 2\n";
> +
> +print "not " unless isvstring($vs);
> +print "ok 3\n";
> +
> +$sv = "1.0";
> +print "not " if isvstring($sv);
> +print "ok 4\n";
> +
> +
->MAGIC returns a list, so you don't actually have to walk the chain.
~/bleadperl/perl $./perl -Ilib -MTie::Scalar -wl
sub has_magic {
require B;
!! eval { grep $_->TYPE eq $_[1], B::svref_2object(\$_[0])->MAGIC }
}
$x = v1.2;
tie $x, "Tie::StdScalar";
print "vstring" if has_magic($x, "V");
print "tiedscalar" if has_magic($x, "q");
__END__
vstring
tiedscalar
But something seems awry w/V magic:
~/bleadperl/perl $./perl -Ilib -MDevel::Peek -we'$x=v1.2; $x=v1.2; Dump $x'
SV = PVMG(0x102a0350) at 0x10272cc8
REFCNT = 1
FLAGS = (RMG,POK,pPOK)
IV = 0
NV = 0
PV = 0x10262d48 "\1\2"\0
CUR = 2
LEN = 3
MAGIC = 0x102a26c8
MG_VIRTUAL = 0
MG_TYPE = PERL_MAGIC_vstring(V)
MG_LEN = 4
MG_PTR = 0x10267b68 "v1.2"
MAGIC = 0x10263ec8
MG_VIRTUAL = 0
MG_TYPE = PERL_MAGIC_vstring(V)
MG_LEN = 4
MG_PTR = 0x10267c08 "v1.2"
~/bleadperl/perl $./perl -Ilib -MDevel::Peek -we'$x=v1.2; $x=10; Dump $x'
SV = PVMG(0x102a0328) at 0x10272cc8
REFCNT = 1
FLAGS = (RMG,IOK,pIOK)
IV = 10
NV = 0
PV = 0x10262d48 "\1\2"\0
CUR = 2
LEN = 3
MAGIC = 0x10263ec8
MG_VIRTUAL = 0
MG_TYPE = PERL_MAGIC_vstring(V)
MG_LEN = 4
MG_PTR = 0x10267c08 "v1.2"
Hmmm, need to replace the magic if it already exists.
> ~/bleadperl/perl $./perl -Ilib -MDevel::Peek -we'$x=v1.2; $x=10; Dump $x'
> SV = PVMG(0x102a0328) at 0x10272cc8
> REFCNT = 1
> FLAGS = (RMG,IOK,pIOK)
> IV = 10
> NV = 0
> PV = 0x10262d48 "\1\2"\0
> CUR = 2
> LEN = 3
> MAGIC = 0x10263ec8
> MG_VIRTUAL = 0
> MG_TYPE = PERL_MAGIC_vstring(V)
> MG_LEN = 4
> MG_PTR = 0x10267c08 "v1.2"
Ooh, that's very bad! I'll take a look at it...
The attached patch should fix it. I nuke the destination SV's V magic before
storing any new value, whether it would eventualy be an NV or another vstring:
$ ./perl -Ilib -MDevel::Peek
$v=v1.2.3; Dump $v;
$v=v2.4; Dump $v;
$v=2.4; Dump $v
__END__
SV = PVMG(0x8199780) at 0x817de38
REFCNT = 1
FLAGS = (RMG,POK,pPOK)
IV = 0
NV = 0
PV = 0x81759b8 "\1\2\3"\0
CUR = 3
LEN = 4
MAGIC = 0x8176cc8
MG_VIRTUAL = 0
MG_TYPE = PERL_MAGIC_v-string(V)
MG_LEN = 6
MG_PTR = 0x817fab0 "v1.2.3"
SV = PVMG(0x8199780) at 0x817de38
REFCNT = 1
FLAGS = (RMG,POK,pPOK)
IV = 0
NV = 0
PV = 0x81759b8 "\2\4"\0
CUR = 2
LEN = 4
MAGIC = 0x8176cc8
MG_VIRTUAL = 0
MG_TYPE = PERL_MAGIC_v-string(V)
MG_LEN = 4
MG_PTR = 0x817fab0 "v2.4"
SV = PVMG(0x8199780) at 0x817de38
REFCNT = 1
FLAGS = (NOK,pNOK)
IV = 0
NV = 2.4
PV = 0x81759b8 "\2\4"\0
CUR = 2
LEN = 4
I also added a little so I could use sv_magic() instead of sv_magicext(), as
well as using mg_find() instead of SvMAGIC().
Thanks, applied as #17937.
Hugo