Questions tagged [perlguts]

10 questions
6
votes
1 answer

What part of Perl does not like NTFS Junctions?

I like the Vista style for pathing, so on a XP machine I've created NTFS junctions C:\Users -> C:\Documents and Settings and ~\Documents -> ~\My Documents, so that I only ever have to write one style of path C:\Users\me\Documents. However,…
Axeman
  • 29,660
  • 2
  • 47
  • 102
5
votes
1 answer

Understanding newRV_inc vs newRV_noinc

In trying to deal with references at the C level I can't seem to figure out the difference (in practice) between newRV_inc and newRV_noinc. To that end I have mocked up this little Inline::C example. #!/usr/bin/env perl use strict; use…
Joel Berger
  • 20,180
  • 5
  • 49
  • 104
4
votes
1 answer

Is there a doc like perlguts/illguts for ruby?

I recently enjoied the illustrated perlguts as fun and easy way to see how things are implemented without the need to dig through sources and would love to read such documentation for ruby. Perlguts provides some information on the workings of the…
matthias krull
  • 4,389
  • 3
  • 34
  • 54
4
votes
2 answers

How can I make Perl store integers as numbers instead of strings?

I'm parsing many numbers from a text file into hash entries consisting of a key and corresponding reference to array of values. Using Devel::Peek and Devel::Size I noticed that the string representation of the numbers is stored along in this data…
Johannes Riecken
  • 2,301
  • 16
  • 17
3
votes
3 answers

How does mro, goto, and set_subname interact?

This is a complex question with regard to mro.pm, and the interplay with set_subname, and goto In troubleshooting a problem, I think the core of my misunderstanding relates to how mro.pm works -- especially with regard to set_subname. What is the…
Evan Carroll
  • 78,363
  • 46
  • 261
  • 468
3
votes
1 answer

Is the value returned by refaddr permanent?

According to Scalar::Util's documentation, refaddr works like this: my $addr = refaddr( $ref ); If $ref is reference the internal memory address of the referenced value is returned as a plain integer. Otherwise undef is returned. However, this…
Flimm
  • 136,138
  • 45
  • 251
  • 267
3
votes
2 answers

Why are Perl's canonical "true" and "false" values PVNV internally?

Perl has a canonical "true" and "false" value which it uses for cases of Boolean negation with ! or not. #!/usr/bin/env perl use strict; use warnings; use Data::Dumper; print Dumper !1; # outputs $VAR1 = ''; print Dumper !!1; # outputs $VAR1…
Kaoru
  • 1,540
  • 11
  • 14
2
votes
0 answers

PNaCl linking to Perl internal error in target

I'm trying to make a PNaCl application that uses WebPorts's NaCl port of Perl, but I'm getting a strange error when linking it. Here's the simple code I was trying to build: #include #include #include…
a spaghetto
  • 1,072
  • 2
  • 14
  • 22
2
votes
2 answers

Are all references live in scalars? even explicit ones?

For instance: use strict; use warnings; use Devel::Peek; Dump({}); Would print the following: SV = IV(0x170fc98) at 0x170fca8 REFCNT = 1 FLAGS = (TEMP,ROK) RV = 0x170fa68 SV = PVHV(0x1715970) at 0x170fa68 REFCNT = 1 FLAGS =…
nixer
  • 115
  • 5
1
vote
0 answers

Is there a simple way to convert json SV or C++ string to HV

I have a json string in my C++ class which I converted to SV and returning to my perl module as a scalar. I am parsing this scalar and convert it to json in my perl module. Instead, I want to convert the json string to a HV or perl hash in my C++…
PMat
  • 2,039
  • 2
  • 29
  • 46