while( ) { my @matches = /(\w+)/g; print join( ',', @matches ), "\n"; } #### while ( ) { while ( /(\w+)/g ) { print $1, "\n"; } }