Anonymous avatar Anonymous committed 80d84c4

Removed the perl slides themselves - they are autogenerated from something
else.

Comments (0)

Files changed (119)

Add a comment to this file

vipe/lecture/Perl/Newbies/Perl_Newbies_Lecture_1.tar.gz

Binary file removed.

Add a comment to this file

vipe/lecture/Perl/Newbies/Perl_Newbies_Lecture_2.tar.gz

Binary file removed.

Add a comment to this file

vipe/lecture/Perl/Newbies/Perl_Newbies_Lecture_3.tar.gz

Binary file removed.

vipe/lecture/Perl/Newbies/lecture1/arrays/comma.html

-<html>
-<head>
-<title>The ',' operator</title>
-<link rel="StyleSheet" href="./../style.css" type="text/css">
-</head>
-<body>
-<table>
-<tr>
-<td>
-<a href="./../" class="nav">Contents</a></td>
-<td>
-<a href="./" class="nav">Up</a></td>
-<td>
-<a href="./" class="nav">Previous</a></td>
-<td>
-<a href="./foreach/" class="nav">Next</a></td>
-</tr>
-</table>
-
-<h1 class="fcs">9.1 The ',' operator</h1>
-
-<p>
-In perl the comma (<tt>,</tt>) is an operator, which we encountered it before
-in function calls. The comma concatenates two arrays. We can use it to
-initialize an array in one call:
-</p>
-
-<p>
-<table class="mycode">
-<tr class="mycode">
-<td class="mycode">
-<pre class="mycode">
-<FONT color=#008080>@lines</FONT> = (<FONT color=#ff00ff>&quot;</FONT><FONT color=#ff00ff>One fish</FONT><FONT color=#ff00ff>&quot;</FONT>, <FONT color=#ff00ff>&quot;</FONT><FONT color=#ff00ff>two fish</FONT><FONT color=#ff00ff>&quot;</FONT>, <FONT color=#ff00ff>&quot;</FONT><FONT color=#ff00ff>red fish</FONT><FONT color=#ff00ff>&quot;</FONT>, <FONT color=#ff00ff>&quot;</FONT><FONT color=#ff00ff>blue fish</FONT><FONT color=#ff00ff>&quot;</FONT>);
-
-<B><FONT color=#804040>for</FONT></B> <FONT color=#008080>$a</FONT> (<FONT color=#ff00ff>0</FONT> .. <FONT color=#008080>$#lines</FONT>)
-{
-    <B><FONT color=#804040>print</FONT></B> <FONT color=#008080>$lines</FONT>[<FONT color=#008080>$a</FONT>], <FONT color=#ff00ff>&quot;</FONT><FONT color=#6a5acd>\n</FONT><FONT color=#ff00ff>&quot;</FONT>;
-}
-</pre>
-</td>
-</tr>
-</table>
-
-
-</p>
-
-<p>
-We can also use it to concatenate two existing arrays:
-</p>
-
-<p>
-<table class="mycode">
-<tr class="mycode">
-<td class="mycode">
-<pre class="mycode">
-<FONT color=#008080>@primes1</FONT> = (<FONT color=#ff00ff>2</FONT>,<FONT color=#ff00ff>3</FONT>,<FONT color=#ff00ff>5</FONT>);
-<FONT color=#008080>@primes2</FONT> = (<FONT color=#ff00ff>7</FONT>,<FONT color=#ff00ff>11</FONT>,<FONT color=#ff00ff>13</FONT>);
-<FONT color=#008080>@primes</FONT> = (<FONT color=#008080>@primes1</FONT>,<FONT color=#008080>@primes2</FONT>,<FONT color=#ff00ff>17</FONT>);
-<FONT color=#008080>@primes</FONT> = (<FONT color=#008080>@primes</FONT>,<FONT color=#ff00ff>19</FONT>);
-
-<B><FONT color=#804040>for</FONT></B> <FONT color=#008080>$a</FONT> (<FONT color=#ff00ff>0</FONT> .. <FONT color=#008080>$#primes</FONT>)
-{
-    <B><FONT color=#804040>print</FONT></B> <FONT color=#008080>$primes</FONT>[<FONT color=#008080>$a</FONT>], <FONT color=#ff00ff>&quot;</FONT><FONT color=#6a5acd>\n</FONT><FONT color=#ff00ff>&quot;</FONT>;
-}
-</pre>
-</td>
-</tr>
-</table>
-
-
-</p>
-
-<p>
-So why it is used in function calls? In perl every function accepts an array
-of arguments and returns an array of return values. That's why the comma is
-useful for calling functions which accept more than one argument.
-</p>
-
-
-
-<hr>
-<table>
-<tr>
-<td>
-<a href="./../" class="nav">Contents</a></td>
-<td>
-<a href="./" class="nav">Up</a></td>
-<td>
-<a href="./" class="nav">Previous</a></td>
-<td>
-<a href="./foreach/" class="nav">Next</a></td>
-</tr>
-</table>
-
-</body>
-</html>
-
-

vipe/lecture/Perl/Newbies/lecture1/arrays/foreach/for_and_dotdot.html

-<html>
-<head>
-<title>The for keyword and the .. operator</title>
-<link rel="StyleSheet" href="./../../style.css" type="text/css">
-</head>
-<body>
-<table>
-<tr>
-<td>
-<a href="./../../" class="nav">Contents</a></td>
-<td>
-<a href="./" class="nav">Up</a></td>
-<td>
-<a href="./" class="nav">Previous</a></td>
-<td>
-<a href="./../functions.html" class="nav">Next</a></td>
-</tr>
-</table>
-
-<h1 class="fcs">9.2.1 The for keyword and the .. operator</h1>
-
-<p>
-The <tt>for</tt> keyword in Perl means exactly the same as <tt>foreach</tt> and
-you can use either one arbitrarily.
-</p>
-
-<p>
-<tt>$a .. $b</tt> is a special operator that returns an array containg the 
-sequence of consecutive integers from <tt>$a</tt> up to and including 
-<tt>$b</tt>. Now one can fully understand the <tt>for $i (1 .. 10)</tt> construct
-that we used in the beginning of this lecture.
-</p>
-
-
-
-<hr>
-<table>
-<tr>
-<td>
-<a href="./../../" class="nav">Contents</a></td>
-<td>
-<a href="./" class="nav">Up</a></td>
-<td>
-<a href="./" class="nav">Previous</a></td>
-<td>
-<a href="./../functions.html" class="nav">Next</a></td>
-</tr>
-</table>
-
-</body>
-</html>
-
-

vipe/lecture/Perl/Newbies/lecture1/arrays/foreach/index.html

-<html>
-<head>
-<title>The foreach loop</title>
-<link rel="StyleSheet" href="../../style.css" type="text/css">
-</head>
-<body>
-<table>
-<tr>
-<td>
-<a href="../../" class="nav">Contents</a></td>
-<td>
-<a href="../" class="nav">Up</a></td>
-<td>
-<a href="../comma.html" class="nav">Previous</a></td>
-<td>
-<a href="for_and_dotdot.html" class="nav">Next</a></td>
-</tr>
-</table>
-
-<h1 class="fcs">9.2 The foreach loop</h1>
-
-<p>
-By using the <tt>foreach</tt> loop we can iterate over all the elements of
-an array, and perform the same set of operations on each one of them. Here's
-an example:
-</p>
-
-<p>
-<table class="mycode">
-<tr class="mycode">
-<td class="mycode">
-<pre class="mycode">
-<FONT color=#008080>@numbers</FONT> = (<FONT color=#ff00ff>15</FONT>,<FONT color=#ff00ff>5</FONT>,<FONT color=#ff00ff>7</FONT>,<FONT color=#ff00ff>3</FONT>,<FONT color=#ff00ff>9</FONT>,<FONT color=#ff00ff>1</FONT>,<FONT color=#ff00ff>20</FONT>,<FONT color=#ff00ff>13</FONT>,<FONT color=#ff00ff>9</FONT>,<FONT color=#ff00ff>8</FONT>,
-    <FONT color=#ff00ff>15</FONT>,<FONT color=#ff00ff>16</FONT>,<FONT color=#ff00ff>2</FONT>,<FONT color=#ff00ff>6</FONT>,<FONT color=#ff00ff>12</FONT>,<FONT color=#ff00ff>90</FONT>);
-
-<FONT color=#008080>$max</FONT> = <FONT color=#008080>$numbers</FONT>[<FONT color=#ff00ff>0</FONT>];
-<FONT color=#008080>$min</FONT> = <FONT color=#008080>$numbers</FONT>[<FONT color=#ff00ff>0</FONT>];
-
-<B><FONT color=#804040>foreach</FONT></B> <FONT color=#008080>$i</FONT> (<FONT color=#008080>@numbers</FONT>[<FONT color=#ff00ff>1</FONT>..<FONT color=#008080>$#numbers</FONT>])
-{
-    <B><FONT color=#804040>if</FONT></B> (<FONT color=#008080>$i</FONT> &gt; <FONT color=#008080>$max</FONT>)
-    {
-        <FONT color=#008080>$max</FONT> = <FONT color=#008080>$i</FONT>;
-    }
-    <B><FONT color=#804040>elsif</FONT></B> (<FONT color=#008080>$i</FONT> &lt; <FONT color=#008080>$min</FONT>)
-    {
-        <FONT color=#008080>$min</FONT> = <FONT color=#008080>$i</FONT>;
-    }
-}
-
-<B><FONT color=#804040>print</FONT></B> <FONT color=#ff00ff>&quot;</FONT><FONT color=#ff00ff>The maximum is </FONT><FONT color=#ff00ff>&quot;</FONT> . <FONT color=#008080>$max</FONT> . <FONT color=#ff00ff>&quot;</FONT><FONT color=#6a5acd>\n</FONT><FONT color=#ff00ff>&quot;</FONT>;
-<B><FONT color=#804040>print</FONT></B> <FONT color=#ff00ff>&quot;</FONT><FONT color=#ff00ff>The minimum is </FONT><FONT color=#ff00ff>&quot;</FONT> . <FONT color=#008080>$min</FONT> . <FONT color=#ff00ff>&quot;</FONT><FONT color=#6a5acd>\n</FONT><FONT color=#ff00ff>&quot;</FONT>;
-</pre>
-</td>
-</tr>
-</table>
-
-
-</p>
-
-<p>
-The <tt>foreach</tt> loop in the example assigns each of the elements of the 
-array which was  passed to it to <tt>$i</tt> in turn, and executes the same 
-set of commands for each value.
-</p>
-
-
-
-<hr>
-<table>
-<tr>
-<td>
-<a href="../../" class="nav">Contents</a></td>
-<td>
-<a href="../" class="nav">Up</a></td>
-<td>
-<a href="../comma.html" class="nav">Previous</a></td>
-<td>
-<a href="for_and_dotdot.html" class="nav">Next</a></td>
-</tr>
-</table>
-
-</body>
-</html>
-
-

vipe/lecture/Perl/Newbies/lecture1/arrays/functions.html

-<html>
-<head>
-<title>Built-In Array Functions</title>
-<link rel="StyleSheet" href="./../style.css" type="text/css">
-</head>
-<body>
-<table>
-<tr>
-<td>
-<a href="./../" class="nav">Contents</a></td>
-<td>
-<a href="./" class="nav">Up</a></td>
-<td>
-<a href="./foreach/for_and_dotdot.html" class="nav">Previous</a></td>
-<td>
-<a href="./x.html" class="nav">Next</a></td>
-</tr>
-</table>
-
-<h1 class="fcs">9.3 Built-In Array Functions</h1>
-
-<h2>push</h2>
-
-<p>
-The <tt>push</tt> function appends an element or an entire array to the
-end of an array variable. The syntax is <tt>push @array_to_append_to, @array_to_append</tt> or <tt>push @array, $elem1</tt>. For example, the primes program from earlier could be written as:
-</p>
-
-<p>
-<table class="mycode">
-<tr class="mycode">
-<td class="mycode">
-<pre class="mycode">
-<FONT color=#0000ff># Put 2 as the first prime so we won't have an empty array,</FONT>
-<FONT color=#0000ff># what might confuse the interpreter</FONT>
-<FONT color=#008080>@primes</FONT> = (<FONT color=#ff00ff>2</FONT>);
-
-MAIN_LOOP: 
-<B><FONT color=#804040>for</FONT></B> <FONT color=#008080>$number_to_check</FONT> (<FONT color=#ff00ff>3</FONT> .. <FONT color=#ff00ff>200</FONT>)
-{
-    <B><FONT color=#804040>foreach</FONT></B> <FONT color=#008080>$p</FONT> (<FONT color=#008080>@primes</FONT>)
-    {
-        <B><FONT color=#804040>if</FONT></B> (<FONT color=#008080>$number_to_check</FONT> % <FONT color=#008080>$p</FONT> == <FONT color=#ff00ff>0</FONT>)
-        {
-            <B><FONT color=#804040>next</FONT></B> MAIN_LOOP;
-        }
-    }
-
-    <FONT color=#0000ff># If we reached this point it means $number_to_check is not</FONT>
-    <FONT color=#0000ff># divisable by any prime number that came before it.</FONT>
-    <B><FONT color=#804040>push</FONT></B> <FONT color=#008080>@primes</FONT>, <FONT color=#008080>$number_to_check</FONT>;
-}
-
-<B><FONT color=#804040>foreach</FONT></B> <FONT color=#008080>$p</FONT> (<FONT color=#008080>@primes</FONT>)
-{
-    <B><FONT color=#804040>print</FONT></B> <FONT color=#008080>$p</FONT>, <FONT color=#ff00ff>&quot;</FONT><FONT color=#ff00ff>, </FONT><FONT color=#ff00ff>&quot;</FONT>;
-}
-<B><FONT color=#804040>print</FONT></B> <FONT color=#ff00ff>&quot;</FONT><FONT color=#6a5acd>\n</FONT><FONT color=#ff00ff>&quot;</FONT>;
-</pre>
-</td>
-</tr>
-</table>
-
-
-</p>
-
-<p>
-Notice that <tt>push</tt> is equivalent to typing 
-<tt>@array = (@array, $extra_elem)</tt>, but it is recommended 
-to use it, because it minimizes error and it executes faster.
-</p>
-
-<h2>pop</h2>
-
-<p>
-<tt>pop</tt> extracts the last element from an array and returns it. Here's a
-short example to demonstrate it:
-</p>
-
-<p>
-<table class="mycode">
-<tr class="mycode">
-<td class="mycode">
-<pre class="mycode">
-<FONT color=#0000ff># This program prints the numbers from 10 down to 1.</FONT>
-<FONT color=#008080>@numbers</FONT> = (<FONT color=#ff00ff>1</FONT> .. <FONT color=#ff00ff>10</FONT>);
-<B><FONT color=#804040>while</FONT></B>(<B><FONT color=#804040>scalar</FONT></B>(<FONT color=#008080>@numbers</FONT>) &gt; <FONT color=#ff00ff>0</FONT>)
-{
-    <FONT color=#008080>$i</FONT> = <B><FONT color=#804040>pop</FONT></B>(<FONT color=#008080>@numbers</FONT>);
-    <B><FONT color=#804040>print</FONT></B> <FONT color=#008080>$i</FONT>, <FONT color=#ff00ff>&quot;</FONT><FONT color=#6a5acd>\n</FONT><FONT color=#ff00ff>&quot;</FONT>;
-}
-</pre>
-</td>
-</tr>
-</table>
-
-
-</p>
-
-<h2>shift</h2>
-
-<p>
-<tt>shift</tt> extracts the <b>first</b> element of an array and returns it. The
-array will be changed to contain only the elements that were previously with 
-the 1 to <tt>scalar(@array)-1</tt> indexes.
-</p>
-
-<p>
-Here's the above example, while using <tt>shift</tt> instead of <tt>pop</tt>:
-</p>
-
-<p>
-<table class="mycode">
-<tr class="mycode">
-<td class="mycode">
-<pre class="mycode">
-<FONT color=#0000ff># This program prints the numbers 1 to 10.</FONT>
-<FONT color=#008080>@numbers</FONT> = (<FONT color=#ff00ff>1</FONT> .. <FONT color=#ff00ff>10</FONT>);
-<B><FONT color=#804040>while</FONT></B>(<B><FONT color=#804040>scalar</FONT></B>(<FONT color=#008080>@numbers</FONT>) &gt; <FONT color=#ff00ff>0</FONT>)
-{
-    <FONT color=#008080>$i</FONT> = <B><FONT color=#804040>shift</FONT></B>(<FONT color=#008080>@numbers</FONT>);
-    <B><FONT color=#804040>print</FONT></B> <FONT color=#008080>$i</FONT>, <FONT color=#ff00ff>&quot;</FONT><FONT color=#6a5acd>\n</FONT><FONT color=#ff00ff>&quot;</FONT>;
-}
-</pre>
-</td>
-</tr>
-</table>
-
-
-</p>
-
-<h2>join</h2>
-
-<p>
-The syntax is <tt>join($separator, @array)</tt> and what it does is 
-concatenates the elements of <tt>@array</tt> while putting <tt>$seperator</tt> in
-between. Here's an example:
-</p>
-
-<p>
-<table class="mycode">
-<tr class="mycode">
-<td class="mycode">
-<pre class="mycode">
-<FONT color=#008080>@myarray</FONT> = (<FONT color=#ff00ff>&quot;</FONT><FONT color=#ff00ff>One fish</FONT><FONT color=#ff00ff>&quot;</FONT>, <FONT color=#ff00ff>&quot;</FONT><FONT color=#ff00ff>Two fish</FONT><FONT color=#ff00ff>&quot;</FONT>, <FONT color=#ff00ff>&quot;</FONT><FONT color=#ff00ff>Red Fish</FONT><FONT color=#ff00ff>&quot;</FONT>, <FONT color=#ff00ff>&quot;</FONT><FONT color=#ff00ff>Blue Fish</FONT><FONT color=#ff00ff>&quot;</FONT>);
-
-<B><FONT color=#804040>print</FONT></B> <B><FONT color=#804040>join</FONT></B>(<FONT color=#ff00ff>&quot;</FONT><FONT color=#6a5acd>\n</FONT><FONT color=#ff00ff>&quot;</FONT>, <FONT color=#008080>@myarray</FONT>), <FONT color=#ff00ff>&quot;</FONT><FONT color=#6a5acd>\n</FONT><FONT color=#ff00ff>&quot;</FONT>;
-</pre>
-</td>
-</tr>
-</table>
-
-
-</p>
-
-
-<h2>reverse</h2>
-
-<p>The <tt>reverse</tt> function returns the array which contains the elements
-of the array passed to it as argument in reverse. Here's an example:</p>
-
-<p>
-<table class="mycode">
-<tr class="mycode">
-<td class="mycode">
-<pre class="mycode">
-<B><FONT color=#804040>print</FONT></B> <FONT color=#ff00ff>&quot;</FONT><FONT color=#ff00ff>Enter some lines:</FONT><FONT color=#6a5acd>\n</FONT><FONT color=#ff00ff>&quot;</FONT>;
-
-<FONT color=#008080>$line</FONT> = &lt;&gt;;
-<B><FONT color=#804040>chomp</FONT></B>(<FONT color=#008080>$line</FONT>);
-<B><FONT color=#804040>while</FONT></B> (<FONT color=#008080>$line</FONT>)
-{
-    <B><FONT color=#804040>push</FONT></B> <FONT color=#008080>@mylines</FONT>, <FONT color=#008080>$line</FONT>;
-    <FONT color=#008080>$line</FONT> = &lt;&gt;;
-    <B><FONT color=#804040>chomp</FONT></B>(<FONT color=#008080>$line</FONT>);
-}
-
-<B><FONT color=#804040>print</FONT></B> <FONT color=#ff00ff>&quot;</FONT><FONT color=#ff00ff>Your lines in reverse are:</FONT><FONT color=#6a5acd>\n</FONT><FONT color=#ff00ff>&quot;</FONT>, <B><FONT color=#804040>join</FONT></B>(<FONT color=#ff00ff>&quot;</FONT><FONT color=#6a5acd>\n</FONT><FONT color=#ff00ff>&quot;</FONT>, <B><FONT color=#804040>reverse</FONT></B>(<FONT color=#008080>@mylines</FONT>)), <FONT color=#ff00ff>&quot;</FONT><FONT color=#6a5acd>\n</FONT><FONT color=#ff00ff>&quot;</FONT>;
-</pre>
-</td>
-</tr>
-</table>
-
-
-</p>
-
-<p>
-Note that by typing <tt>scalar(reverse($scalar))</tt> you get the string that 
-contains the characters of <tt>$scalar</tt> in reverse. 
-<tt>scalar(reverse(@array))</tt> concatenates the array into one string and then
-reverses its characters.
-</p>
-
-
-
-<hr>
-<table>
-<tr>
-<td>
-<a href="./../" class="nav">Contents</a></td>
-<td>
-<a href="./" class="nav">Up</a></td>
-<td>
-<a href="./foreach/for_and_dotdot.html" class="nav">Previous</a></td>
-<td>
-<a href="./x.html" class="nav">Next</a></td>
-</tr>
-</table>
-
-</body>
-</html>
-
-

vipe/lecture/Perl/Newbies/lecture1/arrays/index.html

-<html>
-<head>
-<title>Arrays</title>
-<link rel="StyleSheet" href="../style.css" type="text/css">
-</head>
-<body>
-<table>
-<tr>
-<td>
-<a href="../" class="nav">Contents</a></td>
-<td>
-<a href="../" class="nav">Up</a></td>
-<td>
-<a href="../while/last_and_next.html" class="nav">Previous</a></td>
-<td>
-<a href="comma.html" class="nav">Next</a></td>
-</tr>
-</table>
-
-<h1 class="fcs">9 Arrays</h1>
-
-<p>
-Arrays are a sequence of variables, whose members can be retrieved and 
-assigned to by using their indices. An index passed to an array may well be
-, and usually is another variable.
-</p>
-
-<p>
-To refer to the <tt>$i</tt>'th element of the array <tt>@myarray</tt>, one uses
-the syntax <tt>$myarray[$i]</tt>. This element can be assigned to or its
-value can be retrieved, with the same notation.
-</p>
-
-<p>
-Array indices are whole numbers and the first index is 0. As in the 
-length of a string, the number of elements in an array is bounded only by
-the amount of available memory the computer has.
-</p>
-
-<p>
-The following program prints the primes up to 200:
-</p>
-
-<p>
-<table class="mycode">
-<tr class="mycode">
-<td class="mycode">
-<pre class="mycode">
-<FONT color=#008b8b>$num_primes</FONT> = <FONT color=#ff00ff>0</FONT>;
-
-<FONT color=#0000ff># Put 2 as the first prime so we won't have an empty array,</FONT>
-<FONT color=#0000ff># what might confuse the interpreter</FONT>
-<FONT color=#008b8b>$primes</FONT>[<FONT color=#008b8b>$num_primes</FONT>] = <FONT color=#ff00ff>2</FONT>;
-<FONT color=#008b8b>$num_primes</FONT>++;
-
-MAIN_LOOP: 
-<B><FONT color=#a52a2a>for</FONT></B> <FONT color=#008b8b>$number_to_check</FONT> (<FONT color=#ff00ff>3</FONT> .. <FONT color=#ff00ff>200</FONT>)
-{
-    <B><FONT color=#a52a2a>for</FONT></B> <FONT color=#008b8b>$p</FONT> (<FONT color=#ff00ff>0</FONT> .. (<FONT color=#008b8b>$num_primes</FONT><FONT color=#ff00ff>-1</FONT>))
-    {
-        <B><FONT color=#a52a2a>if</FONT></B> (<FONT color=#008b8b>$number_to_check</FONT> % <FONT color=#008b8b>$primes</FONT>[<FONT color=#008b8b>$p</FONT>] == <FONT color=#ff00ff>0</FONT>)
-        {
-            <B><FONT color=#a52a2a>next</FONT></B> MAIN_LOOP;
-        }
-    }
-
-    <FONT color=#0000ff># If we reached this point it means $number_to_check is not</FONT>
-    <FONT color=#0000ff># divisable by any prime number that came before it.</FONT>
-    <FONT color=#008b8b>$primes</FONT>[<FONT color=#008b8b>$num_primes</FONT>] = <FONT color=#008b8b>$number_to_check</FONT>;
-    <FONT color=#008b8b>$num_primes</FONT>++;
-}
-
-<B><FONT color=#a52a2a>for</FONT></B> <FONT color=#008b8b>$p</FONT> (<FONT color=#ff00ff>0</FONT> .. (<FONT color=#008b8b>$num_primes</FONT><FONT color=#ff00ff>-1</FONT>))
-{
-    <B><FONT color=#a52a2a>print</FONT></B> <FONT color=#008b8b>$primes</FONT>[<FONT color=#008b8b>$p</FONT>], <FONT color=#ff00ff>&quot;</FONT><FONT color=#ff00ff>, </FONT><FONT color=#ff00ff>&quot;</FONT>;
-}
-<B><FONT color=#a52a2a>print</FONT></B> <FONT color=#ff00ff>&quot;</FONT><FONT color=#6a5acd>\n</FONT><FONT color=#ff00ff>&quot;</FONT>;
-
-</pre>
-</td>
-</tr>
-</table>
-
-
-</p>
-
-<p>
-The notation <tt>scalar(@myarray)</tt> can be used to refer to the number
-of elements in an array. This number is equal to the maximal index which
-was assigned in the array plus one. You will also the notation 
-<tt>$#myarray</tt> which is equal to the maximal index itself.
-</p>
-
-<p>
-Thus, for example, the above program could have been written as follows:
-</p>
-
-<p>
-<table class="mycode">
-<tr class="mycode">
-<td class="mycode">
-<pre class="mycode">
-<FONT color=#0000ff># Put 2 as the first prime so we won't have an empty array,</FONT>
-<FONT color=#0000ff># what might confuse the interpreter</FONT>
-<FONT color=#008b8b>$primes</FONT>[<FONT color=#ff00ff>0</FONT>] = <FONT color=#ff00ff>2</FONT>;
-
-MAIN_LOOP: 
-<B><FONT color=#a52a2a>for</FONT></B> <FONT color=#008b8b>$number_to_check</FONT> (<FONT color=#ff00ff>3</FONT> .. <FONT color=#ff00ff>200</FONT>)
-{
-    <B><FONT color=#a52a2a>for</FONT></B> <FONT color=#008b8b>$p</FONT> (<FONT color=#ff00ff>0</FONT> .. <FONT color=#008b8b>$#primes</FONT>)
-    {
-        <B><FONT color=#a52a2a>if</FONT></B> (<FONT color=#008b8b>$number_to_check</FONT> % <FONT color=#008b8b>$primes</FONT>[<FONT color=#008b8b>$p</FONT>] == <FONT color=#ff00ff>0</FONT>)
-        {
-            <B><FONT color=#a52a2a>next</FONT></B> MAIN_LOOP;
-        }
-    }
-
-    <FONT color=#0000ff># If we reached this point it means $number_to_check is not</FONT>
-    <FONT color=#0000ff># divisable by any prime number that came before it.</FONT>
-    <FONT color=#008b8b>$primes</FONT>[<B><FONT color=#a52a2a>scalar</FONT></B>(<FONT color=#008b8b>@primes</FONT>)] = <FONT color=#008b8b>$number_to_check</FONT>;
-}
-
-<B><FONT color=#a52a2a>for</FONT></B> <FONT color=#008b8b>$p</FONT> (<FONT color=#ff00ff>0</FONT> .. <FONT color=#008b8b>$#primes</FONT>)
-{
-    <B><FONT color=#a52a2a>print</FONT></B> <FONT color=#008b8b>$primes</FONT>[<FONT color=#008b8b>$p</FONT>], <FONT color=#ff00ff>&quot;</FONT><FONT color=#ff00ff>, </FONT><FONT color=#ff00ff>&quot;</FONT>;
-}
-<B><FONT color=#a52a2a>print</FONT></B> <FONT color=#ff00ff>&quot;</FONT><FONT color=#6a5acd>\n</FONT><FONT color=#ff00ff>&quot;</FONT>;
-</pre>
-</td>
-</tr>
-</table>
-
-
-</p>
-
-
-
-<hr>
-<table>
-<tr>
-<td>
-<a href="../" class="nav">Contents</a></td>
-<td>
-<a href="../" class="nav">Up</a></td>
-<td>
-<a href="../while/last_and_next.html" class="nav">Previous</a></td>
-<td>
-<a href="comma.html" class="nav">Next</a></td>
-</tr>
-</table>
-
-</body>
-</html>
-
-

vipe/lecture/Perl/Newbies/lecture1/arrays/x.html

-<html>
-<head>
-<title>The x operator</title>
-<link rel="StyleSheet" href="./../style.css" type="text/css">
-</head>
-<body>
-<table>
-<tr>
-<td>
-<a href="./../" class="nav">Contents</a></td>
-<td>
-<a href="./" class="nav">Up</a></td>
-<td>
-<a href="./functions.html" class="nav">Previous</a></td>
-<td>
-<b class="nav">Next</b></td>
-</tr>
-</table>
-
-<h1 class="fcs">9.4 The x operator</h1>
-
-<p>
-The expression <tt>(@array) x $num_times</tt> returns an array that is composed
-of <tt>$num_times</tt> copies of <tt>@array</tt> one after the other. The 
-expression <tt>$scalar x $num_times</tt>, on the other hand, returns 
-a string containing <tt>$num_times</tt> copies of <tt>$scalar</tt> 
-concatenated together string-wise.
-</p>
-
-<p>
-Therefore it is important whether the left operand is wrapped in parenthesis 
-or not. It is usually a wise idea to assign the left part to a variable 
-before using x so you'll have the final expression ready.
-</p>
-
-<p>Here's an example to illustrate the use:</p>
-
-<p>
-<table class="mycode">
-<tr class="mycode">
-<td class="mycode">
-<pre class="mycode">
-<B><FONT color=#804040>print</FONT></B> <FONT color=#ff00ff>&quot;</FONT><FONT color=#ff00ff>Test 1:</FONT><FONT color=#6a5acd>\n</FONT><FONT color=#ff00ff>&quot;</FONT>;
-<FONT color=#008080>@myarray</FONT> = (<FONT color=#ff00ff>&quot;</FONT><FONT color=#ff00ff>Hello</FONT><FONT color=#ff00ff>&quot;</FONT>, <FONT color=#ff00ff>&quot;</FONT><FONT color=#ff00ff>World</FONT><FONT color=#ff00ff>&quot;</FONT>);
-<FONT color=#008080>@array2</FONT> = ((<FONT color=#008080>@myarray</FONT>) x <FONT color=#ff00ff>5</FONT>);
-<B><FONT color=#804040>print</FONT></B> <B><FONT color=#804040>join</FONT></B>(<FONT color=#ff00ff>&quot;</FONT><FONT color=#ff00ff>, </FONT><FONT color=#ff00ff>&quot;</FONT>, <FONT color=#008080>@array2</FONT>), <FONT color=#ff00ff>&quot;</FONT><FONT color=#6a5acd>\n\n</FONT><FONT color=#ff00ff>&quot;</FONT>;
-
-<B><FONT color=#804040>print</FONT></B> <FONT color=#ff00ff>&quot;</FONT><FONT color=#ff00ff>Test 2:</FONT><FONT color=#6a5acd>\n</FONT><FONT color=#ff00ff>&quot;</FONT>;
-<FONT color=#008080>@array3</FONT> = (<FONT color=#008080>@myarray</FONT> x <FONT color=#ff00ff>5</FONT>);
-<B><FONT color=#804040>print</FONT></B> <B><FONT color=#804040>join</FONT></B>(<FONT color=#ff00ff>&quot;</FONT><FONT color=#ff00ff>, </FONT><FONT color=#ff00ff>&quot;</FONT>, <FONT color=#008080>@array3</FONT>), <FONT color=#ff00ff>&quot;</FONT><FONT color=#6a5acd>\n\n</FONT><FONT color=#ff00ff>&quot;</FONT>;
-
-<B><FONT color=#804040>print</FONT></B> <FONT color=#ff00ff>&quot;</FONT><FONT color=#ff00ff>Test 3:</FONT><FONT color=#6a5acd>\n</FONT><FONT color=#ff00ff>&quot;</FONT>;
-<FONT color=#008080>$string</FONT> = <FONT color=#ff00ff>&quot;</FONT><FONT color=#ff00ff>oncatc</FONT><FONT color=#ff00ff>&quot;</FONT>;
-<B><FONT color=#804040>print</FONT></B> ((<FONT color=#008080>$string</FONT> x <FONT color=#ff00ff>6</FONT>), <FONT color=#ff00ff>&quot;</FONT><FONT color=#6a5acd>\n\n</FONT><FONT color=#ff00ff>&quot;</FONT>);
-
-<B><FONT color=#804040>print</FONT></B> <FONT color=#ff00ff>&quot;</FONT><FONT color=#ff00ff>Test 4:</FONT><FONT color=#6a5acd>\n</FONT><FONT color=#ff00ff>&quot;</FONT>;
-<B><FONT color=#804040>print</FONT></B> <B><FONT color=#804040>join</FONT></B>(<FONT color=#ff00ff>&quot;</FONT><FONT color=#6a5acd>\n</FONT><FONT color=#ff00ff>&quot;</FONT>, ((<FONT color=#ff00ff>&quot;</FONT><FONT color=#ff00ff>hello</FONT><FONT color=#ff00ff>&quot;</FONT>) x <FONT color=#ff00ff>5</FONT>)), <FONT color=#ff00ff>&quot;</FONT><FONT color=#6a5acd>\n\n</FONT><FONT color=#ff00ff>&quot;</FONT>;
-
-<B><FONT color=#804040>print</FONT></B> <FONT color=#ff00ff>&quot;</FONT><FONT color=#ff00ff>Test 5:</FONT><FONT color=#6a5acd>\n</FONT><FONT color=#ff00ff>&quot;</FONT>;
-<B><FONT color=#804040>print</FONT></B> <B><FONT color=#804040>join</FONT></B>(<FONT color=#ff00ff>&quot;</FONT><FONT color=#6a5acd>\n</FONT><FONT color=#ff00ff>&quot;</FONT>, (<FONT color=#ff00ff>&quot;</FONT><FONT color=#ff00ff>hello</FONT><FONT color=#ff00ff>&quot;</FONT> x <FONT color=#ff00ff>5</FONT>)), <FONT color=#ff00ff>&quot;</FONT><FONT color=#6a5acd>\n\n</FONT><FONT color=#ff00ff>&quot;</FONT>;
-</pre>
-</td>
-</tr>
-</table>
-
-
-</p>
-
-<p>
-Can you guess what the output of this program will be?
-</p>
-
-<p>Here's a spoiler</p>
-
-<p>
-<table class="mycode">
-<tr class="mycode">
-<td class="mycode">
-<pre class="mycode">
-Test 1:
-Hello, World, Hello, World, Hello, World, Hello, World, Hello, World
-
-Test 2:
-22222
-
-Test 3:
-oncatconcatconcatconcatconcatconcatc
-
-Test 4:
-hello
-hello
-hello
-hello
-hello
-
-Test 5:
-hellohellohellohellohello
-
-</pre>
-</td>
-</tr>
-</table>
-
-
-</p>
-
-
-
-<hr>
-<table>
-<tr>
-<td>
-<a href="./../" class="nav">Contents</a></td>
-<td>
-<a href="./" class="nav">Up</a></td>
-<td>
-<a href="./functions.html" class="nav">Previous</a></td>
-<td>
-<b class="nav">Next</b></td>
-</tr>
-</table>
-
-</body>
-</html>
-
-

vipe/lecture/Perl/Newbies/lecture1/conditionals/boolean.html

-<html>
-<head>
-<title>Boolean Operators</title>
-<link rel="StyleSheet" href="./../style.css" type="text/css">
-</head>
-<body>
-<table>
-<tr>
-<td>
-<a href="./../" class="nav">Contents</a></td>
-<td>
-<a href="./" class="nav">Up</a></td>
-<td>
-<a href="./string.html" class="nav">Previous</a></td>
-<td>
-<a href="./true_vs_false.html" class="nav">Next</a></td>
-</tr>
-</table>
-
-<h1 class="fcs">7.3 Boolean Operators</h1>
-
-<p>
-Sometimes it is useful to check for the validation of more than one condition. 
-For doing this perl supplies us with boolean operators. 
-</p>
-
-<table border="1">
-<tr>
-<td>
-<h2>&&</h2>
-
-<p>
-<tt>$a &amp;&amp; $b</tt> evaluates to true if both <tt>$a</tt> and <tt>$b</tt> are true. 
-It is called the logical and of the two operands <tt>$a</tt> and <tt>$b</tt>.
-</p>
-
-</td>
-</tr>
-<tr>
-<td>
-<h2>||</h2>
-
-<p>
-<tt>$a || $b</tt> (called the logical or of <tt>$a</tt> and <tt>$b</tt>) is 
-evaluated to true if one or both of its operands are true.
-</p>
-
-</td>
-</tr>
-<tr>
-<td>
-
-<h2>!</h2>
-
-<p><tt>! $a</tt> (pronounced "not <tt>$a</tt>") evaluates to true if <tt>$a</tt> is
-false.
-
-</td>
-</tr>
-</table>
-
-<p>
-Note that if the first operand is evaluated to false in an <tt>&amp;&amp;</tt> operation
-, the second operand will not be evaluated at all. Similiarly, if the first 
-operand of <tt>||</tt> was found to be true, the second one will not be evaluated
-either.
-</p>
-
-<p>
-If you wish both operands to be evaluated at all times you need to assign 
-them to variables first.
-</p>
-
-<p>Here are some examples:</p>
-
-<p>
-<table class="mycode">
-<tr class="mycode">
-<td class="mycode">
-<pre class="mycode">
-<B><FONT color=#804040>print</FONT></B> <FONT color=#ff00ff>&quot;</FONT><FONT color=#ff00ff>Please enter the lower bound of the range:</FONT><FONT color=#6a5acd>\n</FONT><FONT color=#ff00ff>&quot;</FONT>;
-<FONT color=#008080>$lower</FONT> = &lt;&gt;;
-<B><FONT color=#804040>chomp</FONT></B>(<FONT color=#008080>$lower</FONT>);
-<B><FONT color=#804040>print</FONT></B> <FONT color=#ff00ff>&quot;</FONT><FONT color=#ff00ff>Please enter the upper bound of the range:</FONT><FONT color=#6a5acd>\n</FONT><FONT color=#ff00ff>&quot;</FONT>;
-<FONT color=#008080>$upper</FONT> = &lt;&gt;;
-<B><FONT color=#804040>chomp</FONT></B>(<FONT color=#008080>$upper</FONT>);
-<B><FONT color=#804040>if</FONT></B> (<FONT color=#008080>$lower</FONT> &gt; <FONT color=#008080>$upper</FONT>)
-{
-    <B><FONT color=#804040>print</FONT></B> <FONT color=#ff00ff>&quot;</FONT><FONT color=#ff00ff>This is not a valid range!</FONT><FONT color=#6a5acd>\n</FONT><FONT color=#ff00ff>&quot;</FONT>;
-}
-<B><FONT color=#804040>else</FONT></B>
-{
-    <B><FONT color=#804040>print</FONT></B> <FONT color=#ff00ff>&quot;</FONT><FONT color=#ff00ff>Please enter a number:</FONT><FONT color=#6a5acd>\n</FONT><FONT color=#ff00ff>&quot;</FONT>;
-    <FONT color=#008080>$number</FONT> = &lt;&gt;;
-    <B><FONT color=#804040>chomp</FONT></B>(<FONT color=#008080>$number</FONT>);
-    <B><FONT color=#804040>if</FONT></B> ((<FONT color=#008080>$lower</FONT> &lt;= <FONT color=#008080>$number</FONT>) &amp;&amp; (<FONT color=#008080>$number</FONT> &lt;= <FONT color=#008080>$upper</FONT>))
-    {
-        <B><FONT color=#804040>print</FONT></B> <FONT color=#ff00ff>&quot;</FONT><FONT color=#ff00ff>The number is in the range!</FONT><FONT color=#6a5acd>\n</FONT><FONT color=#ff00ff>&quot;</FONT>;
-    }
-    <B><FONT color=#804040>else</FONT></B>
-    {
-        <B><FONT color=#804040>print</FONT></B> <FONT color=#ff00ff>&quot;</FONT><FONT color=#ff00ff>The number is not in the range!</FONT><FONT color=#6a5acd>\n</FONT><FONT color=#ff00ff>&quot;</FONT>;
-    }    
-}
-</pre>
-</td>
-</tr>
-</table>
-
-
-</p>
-
-<hr>
-
-<p>
-<table class="mycode">
-<tr class="mycode">
-<td class="mycode">
-<pre class="mycode">
-<B><FONT color=#a52a2a>print</FONT></B> <FONT color=#ff00ff>&quot;</FONT><FONT color=#ff00ff>Please enter your name:</FONT><FONT color=#6a5acd>\n</FONT><FONT color=#ff00ff>&quot;</FONT>;
-<FONT color=#008b8b>$name</FONT> = &lt;&gt;;
-<B><FONT color=#a52a2a>chomp</FONT></B>(<FONT color=#008b8b>$name</FONT>);
-<FONT color=#008b8b>$fl</FONT> = <B><FONT color=#a52a2a>lc</FONT></B>(<B><FONT color=#a52a2a>substr</FONT></B>(<FONT color=#008b8b>$name</FONT>, <FONT color=#ff00ff>0</FONT>, <FONT color=#ff00ff>1</FONT>));
-<B><FONT color=#a52a2a>if</FONT></B> ((<FONT color=#008b8b>$fl</FONT> <B><FONT color=#a52a2a>eq</FONT></B> <FONT color=#ff00ff>&quot;</FONT><FONT color=#ff00ff>a</FONT><FONT color=#ff00ff>&quot;</FONT>)||(<FONT color=#008b8b>$fl</FONT> <B><FONT color=#a52a2a>eq</FONT></B> <FONT color=#ff00ff>&quot;</FONT><FONT color=#ff00ff>b</FONT><FONT color=#ff00ff>&quot;</FONT>)||(<FONT color=#008b8b>$fl</FONT> <B><FONT color=#a52a2a>eq</FONT></B> <FONT color=#ff00ff>&quot;</FONT><FONT color=#ff00ff>c</FONT><FONT color=#ff00ff>&quot;</FONT>))
-{
-    <B><FONT color=#a52a2a>print</FONT></B> <FONT color=#ff00ff>&quot;</FONT><FONT color=#ff00ff>Your name starts with one of the </FONT><FONT color=#ff00ff>&quot;</FONT> .
-        <FONT color=#ff00ff>&quot;</FONT><FONT color=#ff00ff>first three letters of the ABC.</FONT><FONT color=#6a5acd>\n</FONT><FONT color=#ff00ff>&quot;</FONT>;
-}
-<B><FONT color=#a52a2a>else</FONT></B>
-{
-    <B><FONT color=#a52a2a>print</FONT></B> <FONT color=#ff00ff>&quot;</FONT><FONT color=#ff00ff>Your name does not start with one of the </FONT><FONT color=#ff00ff>&quot;</FONT> .
-        <FONT color=#ff00ff>&quot;</FONT><FONT color=#ff00ff>first three letters of the ABC.</FONT><FONT color=#6a5acd>\n</FONT><FONT color=#ff00ff>&quot;</FONT>;
-}
-</pre>
-</td>
-</tr>
-</table>
-
-</p>
-
-<p>
-Note: The function <tt>lc()</tt> converts a string to lowercase.
-</p>
-
-
-
-<hr>
-<table>
-<tr>
-<td>
-<a href="./../" class="nav">Contents</a></td>
-<td>
-<a href="./" class="nav">Up</a></td>
-<td>
-<a href="./string.html" class="nav">Previous</a></td>
-<td>
-<a href="./true_vs_false.html" class="nav">Next</a></td>
-</tr>
-</table>
-
-</body>
-</html>
-
-

vipe/lecture/Perl/Newbies/lecture1/conditionals/elsif.html

-<html>
-<head>
-<title>elsif</title>
-<link rel="StyleSheet" href="./../style.css" type="text/css">
-</head>
-<body>
-<table>
-<tr>
-<td>
-<a href="./../" class="nav">Contents</a></td>
-<td>
-<a href="./" class="nav">Up</a></td>
-<td>
-<a href="./true_vs_false.html" class="nav">Previous</a></td>
-<td>
-<a href="./../while/" class="nav">Next</a></td>
-</tr>
-</table>
-
-<h1 class="fcs">7.5 elsif</h1>
-
-<p>
-The full syntax of the if statement is as follows:
-</p>
-
-<p>
-<table class="mycode">
-<tr class="mycode">
-<td class="mycode">
-<pre class="mycode">
-<tt>if</tt> ($condition0)
-{
-    # If Part
-}
-<tt>elsif</tt> ($condition1)
-{
-    # Else-if 1 part
-}
-<tt>elsif</tt> ($condition2)
-{
-    # Else-if 2 part
-}
-.
-.
-.
-<tt>else</tt>
-{
-    # Else part
-}
-</pre>
-</td>
-</tr>
-</table>
-
-
-</p>
-
-<p>
-The N-th <tt>elsif</tt> block will be executed only if all the conditions 
-in the previous blocks were not met <b>and</b> its own condition was met.
-</p>
-
-<p>
-You can do the same with nesting <tt>if</tt> statements inside <tt>else</tt>
-statements, but isn't it nice of perl to save you all those extra brackets
-and indentations?
-<p>
-
-
-
-<hr>
-<table>
-<tr>
-<td>
-<a href="./../" class="nav">Contents</a></td>
-<td>
-<a href="./" class="nav">Up</a></td>
-<td>
-<a href="./true_vs_false.html" class="nav">Previous</a></td>
-<td>
-<a href="./../while/" class="nav">Next</a></td>
-</tr>
-</table>
-
-</body>
-</html>
-
-

vipe/lecture/Perl/Newbies/lecture1/conditionals/index.html

-<html>
-<head>
-<title>Conditionals</title>
-<link rel="StyleSheet" href="../style.css" type="text/css">
-</head>
-<body>
-<table>
-<tr>
-<td>
-<a href="../" class="nav">Contents</a></td>
-<td>
-<a href="../" class="nav">Up</a></td>
-<td>
-<a href="../for_loop.html" class="nav">Previous</a></td>
-<td>
-<a href="numerical.html" class="nav">Next</a></td>
-</tr>
-</table>
-
-<h1 class="fcs">7 Conditionals</h1>
-
-<p>
-Conditionals enable us to execute a group of statements if a 
-certain condition is met. For example the following program, reports to the
-user whether or not his name starts with the letter "A":
-</p>
-
-<p>
-<table class="mycode">
-<tr class="mycode">
-<td class="mycode">
-<pre class="mycode">
-<B><FONT color=#804040>print</FONT></B> <FONT color=#ff00ff>&quot;</FONT><FONT color=#ff00ff>Please enter your name:</FONT><FONT color=#6a5acd>\n</FONT><FONT color=#ff00ff>&quot;</FONT>;
-<FONT color=#008080>$name</FONT> = &lt;&gt;;
-<B><FONT color=#804040>if</FONT></B> (<B><FONT color=#804040>substr</FONT></B>(<FONT color=#008080>$name</FONT>,<FONT color=#ff00ff>0</FONT>,<FONT color=#ff00ff>1</FONT>) <B><FONT color=#804040>eq</FONT></B> <FONT color=#ff00ff>&quot;</FONT><FONT color=#ff00ff>A</FONT><FONT color=#ff00ff>&quot;</FONT>)
-{
-    <B><FONT color=#804040>print</FONT></B> <FONT color=#ff00ff>&quot;</FONT><FONT color=#ff00ff>Your name starts with 'A'!</FONT><FONT color=#6a5acd>\n</FONT><FONT color=#ff00ff>&quot;</FONT>;
-}
-<B><FONT color=#804040>else</FONT></B>
-{
-    <B><FONT color=#804040>print</FONT></B> <FONT color=#ff00ff>&quot;</FONT><FONT color=#ff00ff>Your name does not start with 'A'!</FONT><FONT color=#6a5acd>\n</FONT><FONT color=#ff00ff>&quot;</FONT>;
-}
-</pre>
-</td>
-</tr>
-</table>
-
-
-</p>
-
-<p>
-The code <tt>substr($name,0,1) eq "A"</tt> is a condition expression which uses 
-the perl <tt>eq</tt> operator, which returns true if and only if the strings 
-are the same. There are more such operators and they will be explained shortly.
-</p>
-
-<p>
-Inside the curly brackets following the <tt>if</tt> there is the code to 
-be executed by the conditional. That code can be as long as you like. The else
-part is executed assuming the conditional was found to be false, and is 
-optional.
-</p>
-
-
-
-<hr>
-<table>
-<tr>
-<td>
-<a href="../" class="nav">Contents</a></td>
-<td>
-<a href="../" class="nav">Up</a></td>
-<td>
-<a href="../for_loop.html" class="nav">Previous</a></td>
-<td>
-<a href="numerical.html" class="nav">Next</a></td>
-</tr>
-</table>
-
-</body>
-</html>
-
-

vipe/lecture/Perl/Newbies/lecture1/conditionals/numerical.html

-<html>
-<head>
-<title>Numerical Comparison Operators</title>
-<link rel="StyleSheet" href="./../style.css" type="text/css">
-</head>
-<body>
-<table>
-<tr>
-<td>
-<a href="./../" class="nav">Contents</a></td>
-<td>
-<a href="./" class="nav">Up</a></td>
-<td>
-<a href="./" class="nav">Previous</a></td>
-<td>
-<a href="./string.html" class="nav">Next</a></td>
-</tr>
-</table>
-
-<h1 class="fcs">7.1 Numerical Comparison Operators</h1>
-
-<p>
-Perl supplies the user with 6 numerical comparison operators which test 
-for the comparison of two numbers. They are:
-</p>
-
-<p>
-<table border="1">
-
-<tr>
-<td>
-<tt>$a == $b</tt>
-</td>
-<td>
-<tt>$a</tt> and <tt>$b</tt> are equal.
-</td>
-</tr>
-
-<tr>
-<td>
-<tt>$a &gt; $b</tt>
-</td>
-<td>
-<tt>$a</tt> is greater than <tt>$b</tt>
-</td>
-</tr>
-
-<tr>
-<td>
-<tt>$a &lt; $b</tt>
-</td>
-<td>
-<tt>$a</tt> is lesser than <tt>$b</tt>
-</td>
-</tr>
-
-<tr>
-<td>
-<tt>$a &gt;= $b</tt>
-</td>
-<td>
-<tt>$a</tt> is greater or equal to <tt>$b</tt>
-</td>
-</tr>
-
-<tr>
-<td>
-<tt>$a &lt;= $b</tt>
-</td>
-<td>
-<tt>$a</tt> is lesser or equal to <tt>$b</tt>
-</td>
-</tr>
-
-<tr>
-<td>
-<tt>$a != $b</tt>
-</td>
-<td>
-<tt>$a</tt> is not equal to <tt>$b</tt>
-</td>
-</tr>
-
-</table>
-</p>
-
-<p>
-Those operators can be used inside conditionals and also outside,
-as part of a normal expression. The following program prints all the numbers 
-between 1 and 100 that are not divisable by 3:
-</p>
-
-<p>
-<table class="mycode">
-<tr class="mycode">
-<td class="mycode">
-<pre class="mycode">
-<B><FONT color=#804040>for</FONT></B> <FONT color=#008080>$a</FONT> (<FONT color=#ff00ff>1</FONT> .. <FONT color=#ff00ff>100</FONT>)
-{
-    <B><FONT color=#804040>if</FONT></B> ((<FONT color=#008080>$a</FONT> % <FONT color=#ff00ff>3</FONT>) != <FONT color=#ff00ff>0</FONT>)
-    {
-        <B><FONT color=#804040>print</FONT></B> <FONT color=#008080>$a</FONT>,<FONT color=#ff00ff>&quot;</FONT><FONT color=#6a5acd>\n</FONT><FONT color=#ff00ff>&quot;</FONT>;
-    }
-}
-</pre>
-</td>
-</tr>
-</table>
-
-
-</p>
-
-
-
-<hr>
-<table>
-<tr>
-<td>
-<a href="./../" class="nav">Contents</a></td>
-<td>
-<a href="./" class="nav">Up</a></td>
-<td>
-<a href="./" class="nav">Previous</a></td>
-<td>
-<a href="./string.html" class="nav">Next</a></td>
-</tr>
-</table>
-
-</body>
-</html>
-
-

vipe/lecture/Perl/Newbies/lecture1/conditionals/string.html

-<html>
-<head>
-<title>String Comparison Operators</title>
-<link rel="StyleSheet" href="./../style.css" type="text/css">
-</head>
-<body>
-<table>
-<tr>
-<td>
-<a href="./../" class="nav">Contents</a></td>
-<td>
-<a href="./" class="nav">Up</a></td>
-<td>
-<a href="./numerical.html" class="nav">Previous</a></td>
-<td>
-<a href="./boolean.html" class="nav">Next</a></td>
-</tr>
-</table>
-
-<h1 class="fcs">7.2 String Comparison Operators</h1>
-
-<p>
-In order to compare for string equality, or if one string is alphabetically 
-bigger than another, you can use the six string comparison operators. Here 
-are the string operators together with the numerical operators they correspond
-too:
-</p>
-
-<p>
-<table border="1">
-<tr>
-<td>
-<b>String Operator</b>
-</td>
-<td>
-<b>Numerical Operator</b>
-</td>
-</tr>
-
-<tr>
-<td>
-<tt>eq</tt>
-</td>
-<td>
-<tt>==</tt>
-</td>
-</tr>
-
-<tr>
-<td>
-<tt>ne</tt>
-</td>
-<td>
-<tt>!=</tt>
-</td>
-</tr>
-
-<tr>
-<td>
-<tt>gt</tt>
-</td>
-<td>
-<tt>&gt;</tt>
-</td>
-</tr>
-
-<tr>
-<td>
-<tt>lt</tt>
-</td>
-<td>
-<tt>&lt;</tt>
-</td>
-</tr>
-
-<tr>
-<td>
-<tt>ge</tt>
-</td>
-<td>
-<tt>&gt;=</tt>
-</td>
-</tr>
-
-<tr>
-<td>
-<tt>le</tt>
-</td>
-<td>
-<tt>&lt;=</tt>
-</td>
-</tr>
-</table>
-</p>
-
-<p>
-Notice that the string operators are built from the initials of their 
-abbreviated names. (E.g: eq = equal, gt = greater than). Perl's string 
-comparison is case-sensitive. If you want a case insensitive 
-string comparison, use the <tt>lc</tt> function to convert the strings to 
-lowercase beforehand.
-</p>
-
-<p>Example:</p>
-
-<p>
-<table class="mycode">
-<tr class="mycode">
-<td class="mycode">
-<pre class="mycode">
-<B><FONT color=#804040>print</FONT></B> <FONT color=#ff00ff>&quot;</FONT><FONT color=#ff00ff>Please enter your private name:</FONT><FONT color=#6a5acd>\n</FONT><FONT color=#ff00ff>&quot;</FONT>;
-<FONT color=#008080>$name</FONT> = &lt;&gt;;
-<B><FONT color=#804040>chomp</FONT></B>(<FONT color=#008080>$name</FONT>);
-<B><FONT color=#804040>if</FONT></B> (<B><FONT color=#804040>lc</FONT></B>(<FONT color=#008080>$name</FONT>) <B><FONT color=#804040>eq</FONT></B> <FONT color=#ff00ff>&quot;</FONT><FONT color=#ff00ff>rachel</FONT><FONT color=#ff00ff>&quot;</FONT>)
-{
-    <B><FONT color=#804040>print</FONT></B> <FONT color=#ff00ff>&quot;</FONT><FONT color=#ff00ff>Your name is Rachel!</FONT><FONT color=#6a5acd>\n</FONT><FONT color=#ff00ff>&quot;</FONT>;
-}
-<B><FONT color=#804040>else</FONT></B>
-{
-    <B><FONT color=#804040>print</FONT></B> <FONT color=#ff00ff>&quot;</FONT><FONT color=#ff00ff>Your name is not Rachel!</FONT><FONT color=#6a5acd>\n</FONT><FONT color=#ff00ff>&quot;</FONT>;
-}
-</pre>
-</td>
-</tr>
-</table>
-
-
-</p>
-
-
-
-<hr>
-<table>
-<tr>
-<td>
-<a href="./../" class="nav">Contents</a></td>
-<td>
-<a href="./" class="nav">Up</a></td>
-<td>
-<a href="./numerical.html" class="nav">Previous</a></td>
-<td>
-<a href="./boolean.html" class="nav">Next</a></td>
-</tr>
-</table>
-
-</body>
-</html>
-
-

vipe/lecture/Perl/Newbies/lecture1/conditionals/true_vs_false.html

-<html>
-<head>
-<title>True Expressions vs. False Expressions</title>
-<link rel="StyleSheet" href="./../style.css" type="text/css">
-</head>
-<body>
-<table>
-<tr>
-<td>
-<a href="./../" class="nav">Contents</a></td>
-<td>
-<a href="./" class="nav">Up</a></td>
-<td>
-<a href="./boolean.html" class="nav">Previous</a></td>
-<td>
-<a href="./elsif.html" class="nav">Next</a></td>
-</tr>
-</table>
-
-<h1 class="fcs">7.4 True Expressions vs. False Expressions</h1>
-
-<p>
-In Perl every expression is considered true except for the following three
-cases:
-</p>
-
-<p>
-<ol>
-<li>
-The number <tt>0</tt>.
-</li>
-<li>
-The empty string (<tt>""</tt>).
-</li>
-<li>
-A special value called <tt>undef</tt>. This is the default value of every
-variable that was not initialized before it was accessed.
-</li>
-</ol>
-</p>
-
-<p>
-One of the most convenient ways of cancelling code is to wrap it in an 
-<tt>if (0) { ... }</tt> block. It usually is faster than adding comments to
-the beginning of each line. Of course, you should not distribute code that 
-way, but it is useful for testing conjectures.
-</p>
-
-
-
-<hr>
-<table>
-<tr>
-<td>
-<a href="./../" class="nav">Contents</a></td>
-<td>
-<a href="./" class="nav">Up</a></td>
-<td>
-<a href="./boolean.html" class="nav">Previous</a></td>
-<td>
-<a href="./elsif.html" class="nav">Next</a></td>
-</tr>
-</table>
-
-</body>
-</html>
-
-

vipe/lecture/Perl/Newbies/lecture1/expressions/functions.html

-<html>
-<head>
-<title>Functions</title>
-<link rel="StyleSheet" href="./../style.css" type="text/css">
-</head>
-<body>
-<table>
-<tr>
-<td>
-<a href="./../" class="nav">Contents</a></td>
-<td>
-<a href="./" class="nav">Up</a></td>
-<td>
-<a href="./operators.html" class="nav">Previous</a></td>
-<td>
-<a href="./strings/" class="nav">Next</a></td>
-</tr>
-</table>
-
-<h1 class="fcs">3.2 Functions</h1>
-
-<p>
-How many characters are in the perl motto? Perl can tell that right away:
-</p>
-
-<!-- TODO: Highlight -->
-<p>
-<table class="mycode">
-<tr class="mycode">
-<td class="mycode">
-<pre class="mycode">
-<B><FONT color=#804040>print</FONT></B> <B><FONT color=#804040>length</FONT></B>(<FONT color=#ff00ff>&quot;</FONT><FONT color=#ff00ff>There's more than one way to do it</FONT><FONT color=#ff00ff>&quot;</FONT>), <FONT color=#ff00ff>&quot;</FONT><FONT color=#6a5acd>\n</FONT><FONT color=#ff00ff>&quot;</FONT>;
-</pre>
-</td>
-</tr>
-</table>
-
-
-</p>
-
-<p>
-<tt>length()</tt> is a built-in function that tells how many characters are in
-a string. A function is a named sub-routine that accepts several arguments
-and returns a value that can be further evaluated as part of a greater 
-expression, or used directly.
-</p>
-
-<p>
-To help us understand functions further, let's inspect the perl function 
-<tt>substr</tt> (short for "sub-string"). <tt>substr</tt> retrieves sub-strings
-of a given string. The first argument to it is a string, the second is the
-offset from which to take the substring, and the third (which is optional
-and defaults to the end of the string) is the length of the substring to be
-taken.
-</p>
-
-<p>
-An example will illustrate it best:
-</p>
-
-<p>
-<table class="mycode">
-<tr class="mycode">
-<td class="mycode">
-<pre class="mycode">
-<B><FONT color=#804040>print</FONT></B> <B><FONT color=#804040>substr</FONT></B>(<FONT color=#ff00ff>&quot;</FONT><FONT color=#ff00ff>A long string</FONT><FONT color=#ff00ff>&quot;</FONT>, <FONT color=#ff00ff>3</FONT>), <FONT color=#ff00ff>&quot;</FONT><FONT color=#6a5acd>\n</FONT><FONT color=#ff00ff>&quot;</FONT>;
-<B><FONT color=#804040>print</FONT></B> <B><FONT color=#804040>substr</FONT></B>(<FONT color=#ff00ff>&quot;</FONT><FONT color=#ff00ff>A long string</FONT><FONT color=#ff00ff>&quot;</FONT>, <FONT color=#ff00ff>1</FONT>, <FONT color=#ff00ff>4</FONT>), <FONT color=#ff00ff>&quot;</FONT><FONT color=#6a5acd>\n</FONT><FONT color=#ff00ff>&quot;</FONT>;
-<B><FONT color=#804040>print</FONT></B> <B><FONT color=#804040>substr</FONT></B>(<FONT color=#ff00ff>&quot;</FONT><FONT color=#ff00ff>A long string</FONT><FONT color=#ff00ff>&quot;</FONT>, <FONT color=#ff00ff>0</FONT>, <FONT color=#ff00ff>6</FONT>), <FONT color=#ff00ff>&quot;</FONT><FONT color=#6a5acd>\n</FONT><FONT color=#ff00ff>&quot;</FONT>;
-</pre>
-</td>
-</tr>
-</table>
-
-
-</p>
-
-<p>
-The output of this program is:
-</p>
-
-<p>
-<table class="mycode">
-<tr class="mycode">
-<td class="mycode">
-<pre class="mycode">
-ong string
- lon
-A long
-</pre>
-</td>
-</tr>
-</table>
-
-
-</p>
-
-<p>( You may notice that the position of the first character is 0. )</p>
-
-<p>The commas are used to separate the arguments to the function and they are 
-mandatory in perl. The parenthesis that enclose them are optional, though. The above
-program could have been re-written as:</p>
-
-<p>
-<table class="mycode">
-<tr class="mycode">
-<td class="mycode">
-<pre class="mycode">
-<B><FONT color=#804040>print</FONT></B> ((<B><FONT color=#804040>substr</FONT></B> <FONT color=#ff00ff>&quot;</FONT><FONT color=#ff00ff>A long string</FONT><FONT color=#ff00ff>&quot;</FONT>, <FONT color=#ff00ff>3</FONT>), <FONT color=#ff00ff>&quot;</FONT><FONT color=#6a5acd>\n</FONT><FONT color=#ff00ff>&quot;</FONT>);
-<B><FONT color=#804040>print</FONT></B> ((<B><FONT color=#804040>substr</FONT></B> <FONT color=#ff00ff>&quot;</FONT><FONT color=#ff00ff>A long string</FONT><FONT color=#ff00ff>&quot;</FONT>, <FONT color=#ff00ff>1</FONT>, <FONT color=#ff00ff>4</FONT>), <FONT color=#ff00ff>&quot;</FONT><FONT color=#6a5acd>\n</FONT><FONT color=#ff00ff>&quot;</FONT>);
-<B><FONT color=#804040>print</FONT></B> ((<B><FONT color=#804040>substr</FONT></B> <FONT color=#ff00ff>&quot;</FONT><FONT color=#ff00ff>A long string</FONT><FONT color=#ff00ff>&quot;</FONT>, <FONT color=#ff00ff>0</FONT>, <FONT color=#ff00ff>6</FONT>), <FONT color=#ff00ff>&quot;</FONT><FONT color=#6a5acd>\n</FONT><FONT color=#ff00ff>&quot;</FONT>);
-</pre>
-</td>
-</tr>
-</table>
-
-
-</p>
-
-<p>
-We need an extra set of parenthesis so <tt>print</tt> (which is also a function) 
-would not be confused and consider only the result of the <tt>substr</tt> 
-operation as its argument. If it makes no sense, then it shouldn't; however, 
-remember that a set of parenthesis, that wraps up the argument list 
-of a function, can do you no harm.
-</p>
-
-<h2>The int() function</h2>
-
-<p>
-Another useful function is int(). This function takes a number and rounds it
-down to a near integer (= whole number). Here's an example:
-</p>
-
-<p>
-<table class="mycode">
-<tr class="mycode">
-<td class="mycode">
-<pre class="mycode">
-<B><FONT color=#804040>print</FONT></B> <FONT color=#ff00ff>&quot;</FONT><FONT color=#ff00ff>The whole part of 5.67 is </FONT><FONT color=#ff00ff>&quot;</FONT> . <B><FONT color=#804040>int</FONT></B>(<FONT color=#ff00ff>5</FONT>.<FONT color=#ff00ff>67</FONT>) . <FONT color=#ff00ff>&quot;</FONT><FONT color=#6a5acd>\n</FONT><FONT color=#ff00ff>&quot;</FONT>;
-</pre>
-</td>
-</tr>
-</table>
-
-
-</p>
-
-
-
-<hr>
-<table>
-<tr>
-<td>
-<a href="./../" class="nav">Contents</a></td>
-<td>
-<a href="./" class="nav">Up</a></td>
-<td>
-<a href="./operators.html" class="nav">Previous</a></td>
-<td>
-<a href="./strings/" class="nav">Next</a></td>
-</tr>
-</table>
-
-</body>
-</html>
-
-

vipe/lecture/Perl/Newbies/lecture1/expressions/index.html

-<html>
-<head>
-<title>Expressions</title>
-<link rel="StyleSheet" href="../style.css" type="text/css">
-</head>
-<body>
-<table>
-<tr>
-<td>
-<a href="../" class="nav">Contents</a></td>
-<td>
-<a href="../" class="nav">Up</a></td>
-<td>
-<a href="../output/semicolons.html" class="nav">Previous</a></td>
-<td>
-<a href="operators.html" class="nav">Next</a></td>
-</tr>
-</table>
-
-<h1 class="fcs">3 Expressions</h1>
-
-<p>
-Perl supports such mathematical operators as <tt>+</tt>, <tt>-</tt>,
-<tt>*</tt> (multiplication), and parenthesis (<tt>( ... )</tt>). An example
-is worth a thousand words:
-</p>
-
-<p>
-<table class="mycode">
-<tr class="mycode">
-<td class="mycode">
-<pre class="mycode">
-<B><FONT color=#a52a2a>print</FONT></B> <FONT color=#ff00ff>&quot;</FONT><FONT color=#ff00ff>5 + 6 = </FONT><FONT color=#ff00ff>&quot;</FONT>, <FONT color=#ff00ff>5</FONT>+<FONT color=#ff00ff>6</FONT>, <FONT color=#ff00ff>&quot;</FONT><FONT color=#6a5acd>\n</FONT><FONT color=#ff00ff>&quot;</FONT>;
-<B><FONT color=#a52a2a>print</FONT></B> <FONT color=#ff00ff>&quot;</FONT><FONT color=#ff00ff>(2 + 3) * 6 = </FONT><FONT color=#ff00ff>&quot;</FONT>, (<FONT color=#ff00ff>2</FONT>+<FONT color=#ff00ff>3</FONT>)*<FONT color=#ff00ff>6</FONT>, <FONT color=#ff00ff>&quot;</FONT><FONT color=#6a5acd>\n</FONT><FONT color=#ff00ff>&quot;</FONT>;
-<B><FONT color=#a52a2a>print</FONT></B> <FONT color=#ff00ff>&quot;</FONT><FONT color=#ff00ff>2 + 3 * 6 = </FONT><FONT color=#ff00ff>&quot;</FONT>, <FONT color=#ff00ff>2</FONT>+<FONT color=#ff00ff>3</FONT>*<FONT color=#ff00ff>6</FONT>, <FONT color=#ff00ff>&quot;</FONT><FONT color=#6a5acd>\n</FONT><FONT color=#ff00ff>&quot;</FONT>;
-<B><FONT color=#a52a2a>print</FONT></B> <FONT color=#ff00ff>&quot;</FONT><FONT color=#ff00ff>2 raised to the power of 8 is </FONT><FONT color=#ff00ff>&quot;</FONT>, <FONT color=#ff00ff>2</FONT>**<FONT color=#ff00ff>8</FONT>, <FONT color=#ff00ff>&quot;</FONT><FONT color=#6a5acd>\n</FONT><FONT color=#ff00ff>&quot;</FONT>;
-<B><FONT color=#a52a2a>print</FONT></B> <FONT color=#ff00ff>&quot;</FONT><FONT color=#ff00ff>10-5 = </FONT><FONT color=#ff00ff>&quot;</FONT>, <FONT color=#ff00ff>10-5</FONT>, <FONT color=#ff00ff>&quot;</FONT><FONT color=#ff00ff>. 5-10 = </FONT><FONT color=#ff00ff>&quot;</FONT>, <FONT color=#ff00ff>5-10</FONT>, <FONT color=#ff00ff>&quot;</FONT><FONT color=#6a5acd>\n</FONT><FONT color=#ff00ff>&quot;</FONT>;
-<B><FONT color=#a52a2a>print</FONT></B> <FONT color=#ff00ff>&quot;</FONT><FONT color=#ff00ff>2/3 = </FONT><FONT color=#ff00ff>&quot;</FONT>, <FONT color=#ff00ff>2</FONT>/<FONT color=#ff00ff>3</FONT>, <FONT color=#ff00ff>&quot;</FONT><FONT color=#6a5acd>\n</FONT><FONT color=#ff00ff>&quot;</FONT>;
-</pre>
-</td>
-</tr>
-</table>
-
-
-</p>
-
-<p>
-The output of this program is:
-</p>
-
-<p>
-<table class="mycode">
-<tr class="mycode">
-<td class="mycode">
-<pre class="mycode">
-shlomi:~/progs/perl# perl operators.pl
-5 + 6 = 11
-(2 + 3) * 6 = 30
-2 + 3 * 6 = 20
-2 raised to the power of 8 is 256
-10-5 = 5. 5-10 = -5
-2/3 = 0.666666666666667
-</pre>
-</td>
-</tr>
-</table>
-
-
-</p>
-
-<p>
-The operators have the same precendence as their mathemtical equivalents. The
-parenthesis are useful for making sure a sub-expression will be evaluated before
-all others do.
-</p>
-
-<table border="1">
-<tr>
-<td>
-<h3>Note:</h3>
-
-You can use commas to print more than one expression at once. It beats 
-writing a separate <tt>print</tt> command for every expression you wish to 
-output. However, for better readability, it is recommended that you will 
-separate your expressions among several prints.
-</td>
-</tr>
-</table>
-
-
-
-<hr>
-<table>
-<tr>
-<td>
-<a href="../" class="nav">Contents</a></td>
-<td>
-<a href="../" class="nav">Up</a></td>
-<td>
-<a href="../output/semicolons.html" class="nav">Previous</a></td>
-<td>
-<a href="operators.html" class="nav">Next</a></td>
-</tr>
-</table>
-
-</body>
-</html>
-
-

vipe/lecture/Perl/Newbies/lecture1/expressions/operators.html

-<html>
-<head>
-<title>Operators and Precendence</title>
-<link rel="StyleSheet" href="./../style.css" type="text/css">
-</head>
-<body>
-<table>
-<tr>
-<td>
-<a href="./../" class="nav">Contents</a></td>
-<td>
-<a href="./" class="nav">Up</a></td>
-<td>
-<a href="./" class="nav">Previous</a></td>
-<td>
-<a href="./functions.html" class="nav">Next</a></td>
-</tr>
-</table>
-
-<h1 class="fcs">3.1 Operators and Precendence</h1>
-
-<p>
-Here are some perl operators of interest.
-</p>
-
-<h3>+,-,*,/</h3>
-
-<p>
-Respectively adds, subtracts, multiplies and divides two floating point 
-numbers.
-</p>
-
-<h3>a ** b</h3>
-
-<p>