Just to throw out another idea, you can also do this...

my $name = "Anthony Bob";
my @letters = grep {!/\s/} split('', $name);

# to test
print "@letters";

It also looks like you wanted upper case.  You can do that with this...

my $name = "Anthony Bob";
my @letters = grep {!/\s/} split('', uc($name));

In both cases the split cuts it up into a list of characters, and grep
filters out the spaces (also newlines & tabs).

Rob


-----Original Message-----
From: awards [mailto:[EMAIL PROTECTED]
Sent: Monday, August 18, 2003 11:30 AM
To: [EMAIL PROTECTED]
Subject: need help decompose word


Hi,

I have no idea how to do this.
I have a name
Anthony Bob
I want to put each letter in an array (no space)
for(0..$numbersofletters){
@letters[c]= A LETTER
}
so when i do print @letters i get
A
N
T
H
O
N
Y
B
O
B
something like that, any help is appreciated.
Anthony



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to