On Apr 14, 2008, at 11:45, Dermot wrote:
Hi,
I am trying to split a string on every 9th character. I thought that
this
my @list = split(/.{9}/, $string);
might do it but it doesn't work.
I thought about using splice but the string is a scalar. If I coudl
force it into an array that would help.
snip
This should do it:
my @nines = /.{9}/g;
Unless you don't want the ninth character, in which case this is what
you want
my @eights = /(.{8})./g;
--
Chas. Owens
wonkden.net
The most important skill a programmer can have is the ability to read.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/