Mine
public text v1 · immutablemy $count = length($content);
my $temp = '';
for(0 .. $count )
{
$temp = substr($content,$_,1);
if( $temp =~ /your pattern/mgsi )
{
printf("stuff");
$temp = "";
}
elsif( $temp =~ /your other pattern/mgsi )
{
print("other stuff");
$temp = "";
}
}