Hi Shannon,

Very close. You are allowed to use a pattern in a split.

my @codes = split(/\s+/,$all_codes);

Should give you what you want. This will split the string on 1 or more spaces.
Look at 'perldoc -f split' for more information.

Cheers,
Kevin

On Wed, Oct 03, 2001 at 09:47:11AM +1000, Shannon Murdoch 
([EMAIL PROTECTED]) said something similar to:
> Hi all,
> 
> I'm trying to get this string (example):
> 
> $all_codes = '4c1 4- 4c2 4-    8b1 8g1';
> 
> in to an array (@codes), using it's whitespace as the delimiter.
> 
> ie. @codes = split(/ /,$all_codes);
> 

-- 
[Writing CGI Applications with Perl - http://perlcgi-book.com]
Deserve it (death)! I daresay he does. Many that live deserve death. And some t
hat die deserve life. Can you give it to them? Then do not be too eager to deal
out death in judgement. For even the wise cannot see all end.
        -- Gandalf (Fellowship of the Ring)

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

Reply via email to