Timothy Johnson <[EMAIL PROTECTED]> writes: > You mean something like this? > > while(<INFILE>){ > push @matches,$_ =~ /(silly)/; > } > > foreach(@matches){ > print $_."\n"; > }
Bingo... but this looks like it might be a sort of default callback or remembered item inside parens. Is it? Anyway it does just what I wanted... thanks In actual usage I wanted to scan some emacs *.el files for pieces of code that contained /diary-[a-z]+/ so altered your code like this: #!/usr/local/bin/perl -w while(<>){ push @matches,$_ =~ /(diary-[a-z]+)/; } foreach(@matches){ print $_."\n"; } and run it like: reg.pl /usr/local/share/emacs/21*/lisp/calendar/*.el Gave me and instant view of all 83 occurences and nothing else. Nice... -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]