in reply to global regex
so, you use only one backreference ($1), that gets populated -from the start-everytime the loop iterates, so what you are doing wrong is assuming that for every file there gotta be separate variables to fill up but the fact is the while(<DATA>){} fetches a new DATA item everytime it goes through and replace it in the $1...hope you got the idea....best of luck/(\w+)/g; print "$1";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: global regex
by biohisham (Priest) on Jul 08, 2009 at 16:11 UTC |