On Thursday 18 April 2002 6:57 pm, Allison Ogle wrote:
> Maybe it is because I am assigning my array to a line from another document
> and not assigning letters dirtectly to the array because it still doesn't
> work. It could be there is something wrong with my code too.
>
>
> $word=; #where is
On Thursday, April 18, 2002, at 03:37 , Mark Anderson wrote:
>
No, you need ++ vs +1. As they say in perl, ++ is magical and will
do want you want. + 1 will not.
Wags ;) ps -- is not magical in the same sense as ++ either.
>>>
>>> How would you decrement a character then?
>>> No, you need ++ vs +1. As they say in perl, ++ is magical and will
>>> do want you want. + 1 will not.
>>>
>>> Wags ;) ps -- is not magical in the same sense as ++ either.
>>
>> How would you decrement a character then? There surely has to be a
>> way?
>
>perldoc -f ord
>perldoc -f chr
>
On Thursday, April 18, 2002, at 03:14 , Elias Assmann wrote:
> On Thu, 18 Apr 2002 [EMAIL PROTECTED] wrote:
>> No, you need ++ vs +1. As they say in perl, ++ is magical and will
>> do want you want. + 1 will not.
>>
>> Wags ;) ps -- is not magical in the same sense as ++ either.
>
> How w
On Thu, 18 Apr 2002 [EMAIL PROTECTED] wrote:
> No, you need ++ vs +1. As they say in perl, ++ is magical and will do want
>you want. + 1 will not.
>
> Wags ;) ps -- is not magical in the same sense as ++ either.
How would you decrement a character then? There surely has to be a
way?
Allison Ogle wrote:
>
> Maybe it is because I am assigning my array to a line from another document
> and not assigning letters dirtectly to the array because it still doesn't
> work. It could be there is something wrong with my code too.
>
> $word=; #where is the filehandle and therefore $wo
Adding one and incrementing are different. You're adding 1. Did you try
incrementing the character?
Instead of this:
$code[$y]=$code[$y]+1;
try
($code[$y])++;
#!/usr/bin/perl
@code = qw( A B C D );
$y = 0;
if( $code[$y] ne "F" ){
print "$code[$y]\n";
($code[$y])++;
print "$code[$y]\n"
/\/\ark
-Original Message-
From: Allison Ogle [mailto:[EMAIL PROTECTED]]
Sent: Thursday, April 18, 2002 11:05 AM
To: Mark Anderson
Subject: RE: Incrementing the letters in an array
If you're suggesting trying
$code[$y]=$code[$y]++;
it brings me one step closer in that
No, you need ++ vs +1. As they say in perl, ++ is magical and will do want
you want. + 1 will not.
Wags ;) ps -- is not magical in the same sense as ++ either.
-Original Message-
From: Allison Ogle [mailto:[EMAIL PROTECTED]]
Sent: Thursday, April 18, 2002 10:58
To: a a
Subject:
27;Allison Ogle'; a a
Subject: RE: Incrementing the letters in an array
Are you looking for something like this?
$array[$x++]; #Moves to the next element in the array
-Original Message-
From: Allison Ogle [mailto:[EMAIL PROTECTED]]
Sent: Thursday, April 18, 2002 9:05 AM
To: a a
S
Are you looking for something like this?
$array[$x++]; #Moves to the next element in the array
-Original Message-
From: Allison Ogle [mailto:[EMAIL PROTECTED]]
Sent: Thursday, April 18, 2002 9:05 AM
To: a a
Subject: Incrementing the letters in an array
Hi,
I have an array which cont
This works:
use warnings;
use strict;
my @letters = qw( A B C D );
for (my $n = 0; $n < 4; $n++){
$letters[$n]++;
}
print "@letters\n";
> -Original Message-
> From: Allison Ogle [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, April 18, 2002 12:05 PM
> To: a a
>
Must be missing something. Here is simple code and increments the current
letter the next:
my $x = 'E';
$x++;
my @array = ();
$array[0] = 'G';
$array[0]++;
printf "%-s %-s\n", $x, $array[0];
Output:
F H
Wags ;)
-Original Message-
From: Allison Ogle [mailto:[EMAIL PROTECTED]
13 matches
Mail list logo