This file is indexed.

/usr/share/doc/kildclient/html/ch07s04.xhtml is in kildclient-doc 3.2.0-2.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml"><head><title>7.4. Saving Variables Permanently</title><link rel="stylesheet" type="text/css" href="docbook.css"/><link rel="stylesheet" type="text/css" href="kildclient.css"/><meta name="generator" content="DocBook XSL Stylesheets V1.79.1"/><link rel="prev" href="sec_sounds.xhtml" title="7.3. Playing Sounds"/><link rel="next" href="ch07s05.xhtml" title="7.5. Controlling Worlds with Perl"/></head><body><header><div class="navheader"><table style="width: 100%; "><tr><th style="text-align: center; " colspan="3">7.4. Saving Variables Permanently</th></tr><tr><td style="width: 20%; text-align: left; "><a accesskey="p" href="sec_sounds.xhtml">Prev</a> </td><th style="width: 60%; text-align: center; ">Chapter 7. Using Perl in KildClient</th><td style="width: 20%; text-align: right; "> <a accesskey="n" href="ch07s05.xhtml">Next</a></td></tr></table><hr/></div></header><section class="sect1" id="idm920"><div class="titlepage"><div><div><h2 class="title" style="clear: both">7.4. Saving Variables Permanently</h2></div></div></div><p>You can define variables for use in your Perl scripts. Since
KildClient has a full-featured Perl interpreter, you can use all kinds
of variables Perl supports (scalars, arrays, hashes, and even
references to build complex data structures), and you use them just
like you would in Perl.</p><p>However, when you close the World, the variables and their
values are lost. However, it is often desirable to keep the values of
variables across sessions, and KildClient has a mechanism for
that.</p><p>A variable can be made <span class="emphasis"><em>permanent</em></span>. All
variables that are marked as permanent will be saved when you close
the World, and will be reloaded from the saved values when the World
is opened again later. This way, their values are saved across
sessions.</p><p>To make a variable permanent, open the World Editor (see <a class="xref" href="chap_world_editor.xhtml" title="Chapter 4. Editing a World">Chapter 4, <em>Editing a World</em></a>) and select the
<span class="guilabel">Variables</span> section inside
<span class="guilabel">Automation</span>.</p><p>There you will see a list of the variables that are set to be
permanent:</p><div class="figure" id="idm932"><div class="figure-title">Figure 7.1. Permanent Variables</div><div class="figure-contents"><div class="mediaobject"><img src="images/we_vars.png" alt="Permanent Variables."/></div></div></div><br class="figure-break"/><p>To add a variable, click the <span class="guilabel">Add</span> button. A
window will open for you to enter the name of the variable.</p><p>To make one or more variables temporary again, select them and
press <span class="guilabel">Delete</span>. They will be removed from the
list.</p><p>Finally, if you mispell the name of a variable, select it and
press <span class="guilabel">Edit</span> to correct it.</p><p>You can also change the order of the variables with the
<span class="guilabel">Up</span> and <span class="guilabel">Down</span> buttons. This is
usefor for grouping similar variables together, but does not otherwise
affect the saving of the variables.</p><section class="sect2" id="idm949"><div class="titlepage"><div><div><h3 class="title">7.4.1. Permanent Variables in the Command Line</h3></div></div></div><p>It is possible to make a variable permanent from the command
line. To do that, use the <code class="function">$world-&gt;makepermanent</code>
function, passing the name of the variable as the argument. Note that
since you must pass the name of the variable, you must use quotes, and
preferably single quotes so that the variable does not get
interpolated. For example, to make the variable
<code class="varname">$kill_count</code> permanent, run
<strong class="userinput"><code>$world-&gt;makepermanent('$kill_count')</code></strong>. Now when
you close the World, the value of <code class="varname">$kill_count</code> will
be saved, and when you reopen it later, the value will be
restored.</p><p>It is possible to make more than one variable permanent at one
time, just pass all their names as arguments to
<code class="function">$world-&gt;makepermanent</code>.</p><p>If you want a variable to stop being permanent (that is, to
become <span class="emphasis"><em>temporary</em></span> again), use the
<code class="function">$world-&gt;maketemporary</code> function. It is called just
like <code class="function">makepermanent</code>, and has the opposite
effect.</p><p>To get a list of the variables that are currently permanent, use
the function <code class="function">$world-&gt;listpermanent</code>. This function
has no arguments, and prints all the names of the variables that are
permanent.</p></section></section><footer><div class="navfooter"><hr/><table style="width: 100%; "><tr><td style="width: 40%; text-align: left; "><a accesskey="p" href="sec_sounds.xhtml">Prev</a> </td><td style="width: 20%; text-align: center; "><a accesskey="u" href="chap_perl.xhtml">Up</a></td><td style="width: 40%; text-align: right; "> <a accesskey="n" href="ch07s05.xhtml">Next</a></td></tr><tr><td style="width: 40%; text-align: left; vertical-align: top; ">7.3. Playing Sounds </td><td style="width: 20%; text-align: center; "><a accesskey="h" href="index.xhtml">Home</a></td><td style="width: 40%; text-align: right; vertical-align: top; "> 7.5. Controlling Worlds with Perl</td></tr></table></div></footer></body></html>