in reply to global regex
orwhile( <DATA> ) { my @matches = /(\w+)/g; print join( ',', @matches ), "\n"; }
also, you're missing a semicolon after the regexp, but I assume that you just typed that out, and didn't cut and paste =)while ( <DATA> ) { while ( /(\w+)/g ) { print $1, "\n"; } }
|
---|