summaryrefslogtreecommitdiff
path: root/pkgtools
diff options
context:
space:
mode:
authorrillig <rillig@pkgsrc.org>2006-07-21 05:11:34 +0000
committerrillig <rillig@pkgsrc.org>2006-07-21 05:11:34 +0000
commite562c8fde5aecafca1db32053f34499e8cf00280 (patch)
tree5f6aada8c8ccebbb79247b30080f3bc8a24c8a60 /pkgtools
parentdc0908c3bb17ac01125d5cc6889ec05748bef155 (diff)
downloadpkgsrc-e562c8fde5aecafca1db32053f34499e8cf00280.tar.gz
Parameters to subroutines are passed in @_, not in $@. Added a paragraph
explaining the extreme slowliness of the current Perl interpreter.
Diffstat (limited to 'pkgtools')
-rw-r--r--pkgtools/pkglint/files/doc/chap.code.xml12
1 files changed, 10 insertions, 2 deletions
diff --git a/pkgtools/pkglint/files/doc/chap.code.xml b/pkgtools/pkglint/files/doc/chap.code.xml
index 85914d66c0f..5b8d62c2974 100644
--- a/pkgtools/pkglint/files/doc/chap.code.xml
+++ b/pkgtools/pkglint/files/doc/chap.code.xml
@@ -1,4 +1,4 @@
-<!-- $NetBSD: chap.code.xml,v 1.4 2006/05/20 14:26:00 rillig Exp $ -->
+<!-- $NetBSD: chap.code.xml,v 1.5 2006/07/21 05:11:34 rillig Exp $ -->
<chapter id="code">
<title>Code structure</title>
@@ -235,7 +235,7 @@
<para>The first example are subroutines and their parameters. In
most other languages, the names of the parameters are mentioned in
the subroutine definition. Not so in Perl. The parameters to each
- subroutine are passed in the <literal>$@</literal> array. The usual
+ subroutine are passed in the <literal>@_</literal> array. The usual
way to get named parameters is to write assign the parameter array
to a list of local variables. This extra statement is a nuisance,
but it is merely syntactical.</para>
@@ -282,6 +282,14 @@
a string representation of the reference and match the regular
expression against that.</para>
+ <para>The current Perl interpreter is very inefficient when
+ copying strings. This happens really often in pkglint, for
+ example when passing arguments to functions or saving the result
+ of a regular expression match in <quote>real</quote> variables.
+ For a great speed-up, an implementation that handles string
+ objects by reference-counting them would be better. (Lua comes
+ to mind.)</para>
+
</sect1>
<sect1 id="code.lang">
<title>Switching to another language</title>