summaryrefslogtreecommitdiff
path: root/pod
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2003-02-16 09:47:02 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2003-02-16 09:47:02 +0000
commit35209cc889c47c22db67b1eb1f83d963b429057a (patch)
tree574552b404782fb6f01066421adf538dc0052bf1 /pod
parent9f21530fbfcfd9e38d6db2986fb0ca799bda8f60 (diff)
downloadperl-35209cc889c47c22db67b1eb1f83d963b429057a.tar.gz
As suggested by Sarathy, add -DPERL_HIDE_SHORT_NAMES option
which will disable the short forms of the Perl_ API, good for embedding stuff. (Kind of like the old NO_EMBED, but better.) p4raw-id: //depot/perl@18718
Diffstat (limited to 'pod')
-rw-r--r--pod/perlembed.pod18
1 files changed, 18 insertions, 0 deletions
diff --git a/pod/perlembed.pod b/pod/perlembed.pod
index b9aae2d87a..24385dd354 100644
--- a/pod/perlembed.pod
+++ b/pod/perlembed.pod
@@ -1038,6 +1038,24 @@ also need this path so it knows where to find Perl include files.
This path can be added via the Tools -> Options -> Directories menu.
Finally, select Build -> Build interp.exe and you're ready to go.
+=head1 Hiding Perl_
+
+If you completely hide the short forms forms of the Perl public API,
+add -DPERL_HIDE_SHORT_NAMES to the compilation flags. This means that
+for example instead of writing
+
+ warn("%d bottles of beer on the wall", bottlecount);
+
+you will have to write the explicit full form
+
+ Perl_warn(aTHX_ "%d bottles of beer on the wall", bottlecount);
+
+(See L<perlguts/Background and PERL_IMPLICIT_CONTEXT for the explanation
+of the C<aTHX_>.> ) Hiding the short forms is very useful for avoiding
+all sorts of nasty (C preprocessor or otherwise) conflicts with other
+software packages (Perl defines about 2400 APIs with these short names,
+take or leave few hundred, so there certainly is room for conflict.)
+
=head1 MORAL
You can sometimes I<write faster code> in C, but