Questions tagged [xs]

XS is a language extension for Perl that can wrap a C library to make it a Perl library.

The documentation is available at http://perldoc.perl.org/perlxs.html.

The characters "xs" are also a commonly-used name for the XML Schema namespace. Questions about XML Schema should use .

130 questions
0
votes
1 answer

Perl XS Memory Handling of Strings

I have an XSUB like this: char * string4() CODE: char *str = strdup("Hello World4"); int len = strlen(str) + 1; New(0, RETVAL, len, char); Copy(str, RETVAL, len, char); free(str); OUTPUT: RETVAL But this shows up as a memory…
gaijin
  • 185
  • 1
  • 10
0
votes
2 answers

activestate perl windows - find all installed xs modules

For prepairing a perl upgrade, i wanted to know which perl xs modules are installed for my local activestate perl 5.16 installation. Does anybody know how i could get such a list of perl modules?
0
votes
1 answer

Calling a C++ program from Perl code

I write perl code that calls a submodule tens of millions times. The submodule is computationally intensive and its runtime is very slow. I find a C++ program that exactly does what the submodule does and I would like to substitute the submodule…
0
votes
1 answer

Prevent C++ exception from crashing my Perl script

I have a Perl script that uses some C++ library which is probably wrapped using xs. When the library throws an exception it crashes my Perl script even when called from inside eval. How can I skip the exception and prevent my script from…
Ark-kun
  • 6,358
  • 2
  • 34
  • 70
0
votes
2 answers

XS PPCODE not behaving

I'm working on calling a third-party DLL from my Perl project using XS, under Cygwin on Windows using g++. One of the DLL functions takes a struct as an argument and returns its main results in a pointer to a struct. For now I pass in a flat list…
0
votes
1 answer

How can I subclass DBI to hide user credentials?

I want to subclass the DBI module to hide the connect subroutine with C code. For example, I have: $dbh = DBI->connect($data_source, $username, $auth, \%attr); I want to write some C code which calls the above DBI->connect subroutine and returns…
smith
  • 3,232
  • 26
  • 55
0
votes
1 answer

Using Text::CSV_XS perl module for parsing CSV with newlines

We are using Text::CSV_XS module for parsing CSV with the following options: my $csv = Text::CSV_XS->new ({ binary=> 1, eol => "\n", allow_loose_quotes => 1, …
Pawan Rao
  • 49
  • 9
0
votes
1 answer

perl Text::CSV_XS removes all escape_chars

I had moved from Text::CSV to the XS version because of a problem of newline inside data Text::CSV parsing when data contains newline Text::CSV_XS removes all the escape chars in the data ( I am using linux with perl 5.8.8 ) This is the sample…
Ram
  • 1,155
  • 13
  • 34
-1
votes
1 answer

How do I get f_type from statfs?

I need to get f_type from statfs. I tried patching Filesys::Df: --- Df.pm | 6 +++--- Makefile.PL | 7 +------ XS_statfs | 1 + 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/Df.pm b/Df.pm index b24bd9c..986082a 100644 ---…
daxim
  • 39,270
  • 4
  • 65
  • 132
-1
votes
1 answer

how to check if each row has all columns defined matching headers in csv_xs perl

I have requirement to check if each row in a csv file has all columns defined as per header even if no value it should be like '||' where '|' is seperator. example: EmpId|EmpName|EmpSalary|EmpDept -> Header 001|AAA|100|Dept1 002|BBB||Dept2 --> this…
Kumar
  • 1
1 2 3
8
9