Note: I answer my own question at the bottom of this post, so maybe this shouldn't be on SOPW. If posting this kind of thing is annoying, sorry... I would have deleted my message except there's no function for doing this that I can see :)

Fletch, thanks for the tip (below)!

I have only been programming perl 6 months or so and am just getting my sea legs, so maybe I shouldn't be asking an xs question. But I'm just curious, and I'm not sure what I should be feeding into the search engines to get an answer to this, and perhaps there are others like me... so here goes. I was browsing cpan

http://search.cpan.org/src/JDUNCAN/Regexp-Copy-0.06/lib/Regexp/Copy.pm
for module "regexp::copy" where we have
package Regexp::Copy; use strict; use vars qw($VERSION @ISA @EXPORT @EXPORT_OK); use Regexp::Storable; require Carp; require Exporter; require DynaLoader; require AutoLoader; @ISA = qw(Exporter DynaLoader); @EXPORT = qw( ); @EXPORT_OK = qw(re_copy); $VERSION = '0.06'; bootstrap Regexp::Copy $VERSION; sub re_copy { for (@_) { if (uc(ref($_)) eq ref($_) && !$_->isa('Regexp')) { Carp::croak "parameters to re_copy must be blessed and isa(Regex +p)"; } } re_copy_xs(@_); } 1; __END__
My question concerns the line
re_copy_xs(@_);
What is this? From my (admittedly pretty nebulous) understanding of xs, I am guessing that this function is somehow autogenerated... maybe autogenerated in c. Is that correct? Or barking up the wrong tree? Where can I learn more about modules that end in
some_function_xs
(If this is something one sees commonly that is!) Thanks for your wisdom! thomas.

UPDATE: On second thought, I just noticed we have

use Regexp::Storable;
I'm guessing the answer to my question lies in this module, and not in some cryptic xs thing. Never mind!

UPDATE 2: Anyway, for what it's worth, whatever re_copy_xs is doing, the source is here:

http://search.cpan.org/src/JDUNCAN/Regexp-Copy-0.06/Copy.xs

I will now stop mucking with things I don't understand :)


In reply to xs question - is function_xs autogeneraged? by tphyahoo

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.