From 9042e4d2f96665135b6b5e7119663f6e6005a52f Mon Sep 17 00:00:00 2001 From: Olly Betts Date: Mon, 13 Jul 2009 11:36:20 +0000 Subject: [PATCH] Document -const option. git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11391 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- Doc/Manual/Perl5.html | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/Doc/Manual/Perl5.html b/Doc/Manual/Perl5.html index f77dc2f01..b5ad99769 100644 --- a/Doc/Manual/Perl5.html +++ b/Doc/Manual/Perl5.html @@ -815,7 +815,7 @@ extern char *path; // Declared later in the input

-Constants are wrapped as read-only Perl variables. For example: +By default, constants are wrapped as read-only Perl variables. For example:

@@ -838,6 +838,19 @@ $example::FOO = 2; # Error
+

+Alternatively, if you use swig's -const option, constants are wrapped +such that the leading $ isn't required (by using a constant subroutine), which +usually gives a more natural Perl interface, for example: +

+ +
+
+use example;
+print example::FOO,"\n";
+
+
+

28.4.4 Pointers