use Data::Pointer qw( char_ptr ); for(my $p = char_ptr("a string of characters"); $p->deref; $p->incr) { print '[', $p->deref, ']'; } __output__ [a][ ][s][t][r][i][n][g][ ][o][f][ ][c][h][a][r][a][c][t][e][r][s]