Hi, I'm troubled by something I guess is easy to solve.
I have a web site form, with two edit boxed, the user
should write in two numbers there and the result should be
their sum. I wrote something like this
sub sum
{
$result = $_[0] + $_[1];
return $result;
}
The user types in 4 and 5. And
Hi, I have a problem with SWITCH. I wrote this, I think
it's clear to anzone what it should do:
print "Type in a number 1-5: ";
$s = ;
SWITCH;
{
if ($s == 1) { print "one\n"; last SWITCH; }
if ($s == 2) { print "two\n"; last SWITCH; }
if ($s == 3) { print "three\n"; last SWITCH; }
if ($s == 4
Hi,
I'm trying to write a simple Hanoi tower program. Here is
the procedure I've wrote (with line numbers):
# hanoj (src,hlp,tgt,num)
# src,tgt,hlp,n-1 src,hlp,tgt,1 hlp,src,tgt,n-1
3: sub hanoj
4: {
5: if ($_[3] <= 1)
6: {
7:print "From $_[0] we put on $_[2] with the help of $_
[1]
While I'm at silly questions, I guess I could ask this one
too: what is the difference between a " " and a ' '. I have
a book that explains it to me in one sentence, and I don't
understand one word that the author's using (I suck at
English), so could someone explain it to me? An example
would
Hi,
I've started learning Perl a few days ago, but I'm a
computer science student, so I'm not a complete idiot
:)
This is the problem: I'm trying to make a simple 2D
matrix that represents the product of the numbers 1-10
(don't know how to tell it in English, it's that table
that kids learn when