use constant FRED=>'fred'; my @s = qw[ the=the quick=quick brown=brown fred=fred1 jumped=jumped over=over the=the lazy=lazy fred=fred2 ]; $_ =~ ( FRED . '=(.*)$' ) and print "Found $1" for @s; Found fred1 Found fred2