BUT --- what if that regex occurs more than once in the file? it'll match and stop at that instance. how do i get to more occurrances of what i'm hunting for if i'm slurping the whole file into a variable?undef $/; open INFILE, "<$file"; my @filecontents = <INFILE>; close INFILE; foreach my $filepieces (@filecontents) { if ($filepieces =~ /SOME_REGEX/smg) { # do something w/ match }
In reply to getting a regex to return an array of matches? by rmexico
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |