develooper Front page | perl.beginners | Postings from August 2009

Re: source code for builtin functions

Thread Previous | Thread Next
From:
Paul Johnson
Date:
August 27, 2009 16:29
Subject:
Re: source code for builtin functions
Message ID:
20090827232940.GA8712@pjcj.net
On Thu, Aug 27, 2009 at 06:34:53PM -0400, Shawn H. Corey wrote:
> Telemachus wrote:
>> On Thu Aug 27 2009 @  2:40, heyi xiao wrote:
>>> I knew perl is written in C, but I am still interested in
>>> checking the C source for some builtin function directly. Is there any good way
>>> to go?
>>
>> If you browse to this site, you can download the source code for whatever
>> version of Perl you're working with and read away:
>>
>> http://www.cpan.org/src/README.html
>
> Perhaps you should take your question to the Perl5Porters list  
> http://www.perlfoundation.org/perl5/index.cgi?perl5_porters  After all,  
> they're the ones who maintain it.

I don't think there's any need for that.  I also don't think this is an
inappropriate question for this list or that the C code is particularly ugly
for that matter, but there you go.

Anyway, to answer your question, get the code from the link above and look at
pp*.c.  reverse(), taking your example, can be found by searching for
pp_reverse in pp.c.  If you are serious about understanding the code you'll
also want to read pod/perlguts.pod.

Good luck,

-- 
Paul Johnson - paul@pjcj.net
http://www.pjcj.net

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About