#!/opt/bin/perl $str = 'The quick brown fox jumps over the lazy dog.'; while ( $str =~ /[aeiou]/ig ) { printf( "%d %s\n", pos( $str ), substr( $str, pos( $str ) - 1 ) ); substr( $str, 0, pos( $str ), '' ); }