179 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
1
vote
1
answer
264
views
Perl script crashes with mremap_chunk(): invalid pointer or segmentation fault after exit 0
I'm running a Perl script where everything appears to execute correctly, but it crashes immediately after calling exit 0;.
Whether I run the script normally or with perl -d, the crash still happens.
...
0
votes
0
answers
83
views
Why does this function run slower with a cache than without a cache?
#include "EXTERN.h"
#include "perl.h"
#include "XSUB.h"
#ifdef AMBIGUOUS_WIDTH_IS_WIDE
#include "unicode_table_ambiguous_is_wide.h"
#else
#include "...
5
votes
1
answer
198
views
Multiple embedded Perl instances in multithreaded environment
Currently I am developing an ASP.NET application that for legacy reasons needs to execute some Perl scripts. For this I wrote a small C++ library that uses the embedded Perl API. This library has one ...
4
votes
1
answer
250
views
How to return a hashref when using perl XS
I have the following challenge: bind a code written in Go with Perl (5.12.2)
In the past I use CGO + XS and it works as a charm, however my input was a string and the output, a boolean.
Now I need to ...
1
vote
1
answer
155
views
Does Perl C-API have an utf8-aware sv_insert variant?
I am having some trouble with DBD-Oracle, when an SQL-statement has some problem and DBD-oracle inserts marker <*> at the error-offset via sv_insert.
With setting NLS_LANG=.AL32UTF8, the error-...
0
votes
1
answer
153
views
Stream YAML output, rather than loading everything into memory
I am using Perl with YAML::XS to write YAML output. Specifically, this YAML output is a list of the contents of other YAML files. I'm doing so, for example, like this:
use YAML::XS qw(LoadFile ...
3
votes
1
answer
158
views
Perl Text::CSV_XS treats comment as data when it is the last line
I wonder if this is a bug or feature of Text::CSV_XS. When the last line in my CSV is a comment, it will be parsed as a line containing data (yielding undef or ""). How to repodruce:
$ cat ...
Jens's user avatar
- 73.4k
1
vote
1
answer
109
views
Perl: force Spreadsheet::Read to use Text::CSV_XS
I have an 8MB CSV file. Using Spreadsheet::Read it takes 10 seconds to read:
my $book = ReadData ( 'file.csv' );
my @rows = Spreadsheet::Read::rows($book->[1]); # first sheet
foreach my $i (2 .. ...
1
vote
0
answers
63
views
Embedded Perl FREETMPS not cleaning up array of hash references properly
I have a project with several macros to help me write Perl functions, and basically "convert" C structs into Perl hashes. Some of these hashes nest each other, but I'll get to the point.
My ...
3
votes
1
answer
142
views
How to use perlapi/ XS in an XSUB for array element insertion and removal
I would like to insert and remove elements into an existing Perl array passed into a XSUB.
perlapi has av_push, av_pop, av_fetch, av_store and friends for array manipulation. I was hoping for ...
drclaw's user avatar
- 2,513
2
votes
1
answer
292
views
Perl XS: create and return array of strings (char*) taken from calling a C function or undef on failure
I have Perl XS code which calls a function from an external C library which returns char ** (array of strings).
The XS code will eventually return back to Perl an array ref with all the string results ...
2
votes
1
answer
192
views
How to avoid warning [-Wpointer-sign] of SvPV() versus utf8n_to_uvchr() - bug of XS?
This is the relevant part of XS, which should convert an Perl string from UTF-8 to codepoints (unsigned 32-bit integers):
UV *
text2UV (SV *sv, STRLEN *lenp)
{
STRLEN len;
// char *str = SvPV(...
3
votes
0
answers
118
views
PerlXS: Possible crash trying to free()
I am seeing subtle crashes, which I think is down to the following XS code:
void
tiff_ReadRawStrip (tif, strip, size)
TIFF *tif
uint32_t strip
...
2
votes
1
answer
77
views
How to get named matches XS?
So I'm calling C code from inside mid pattern (using (?{ and sometimes (??{) from Perl.
Anyway I want to get the values of named captures the same way as using $+{name}.
Is this possible?
2
votes
1
answer
270
views
How to tell MakeMaker to add exactly the libraries I want?
I'm using XS to create a Perl Module which uses a C library.
For testing purposes, I've created a test library which has two simple functions:
void kzA() (does a simple printf)
void kzB(int i, char *...