Re: Incrementing the letters in an array

2002-04-19 Thread Gary Stainburn
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

Re: Incrementing the letters in an array

2002-04-18 Thread drieux
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?

RE: Incrementing the letters in an array

2002-04-18 Thread Mark Anderson
>>> 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 >

Re: Incrementing the letters in an array

2002-04-18 Thread drieux
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

RE: Incrementing the letters in an array

2002-04-18 Thread Elias Assmann
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?

Re: Incrementing the letters in an array

2002-04-18 Thread John W. Krahn
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

RE: Incrementing the letters in an array

2002-04-18 Thread Stout, Joel R
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"

RE: Incrementing the letters in an array

2002-04-18 Thread Mark Anderson
/\/\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

RE: Incrementing the letters in an array

2002-04-18 Thread Wagner-David
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:

RE: Incrementing the letters in an array

2002-04-18 Thread Timothy Johnson
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

RE: Incrementing the letters in an array

2002-04-18 Thread Timothy Johnson
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

RE: Incrementing the letters in an array

2002-04-18 Thread Nikola Janceski
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 >

RE: Incrementing the letters in an array

2002-04-18 Thread Wagner-David
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]