Indeed your match is greedy. Still we can change it as follows:
$ perl -nle 'print $1 while /constant=(^ +)\s/g' < test.txt barney@gmail.com wilma@aol.com
In reply to Re^3: grep question using multiple lines
by skx
in thread grep question using multiple lines
by bradcathey
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |