in reply to qr expression defined as constant?

jwkrahn has the solution above, but this is probably what you were trying to do:
my ($y, $m, $d) = ($s =~ /@{[REGEX]}/)[0, 1, 2];
However, might I suggest you look at the Readonly module on cpan for an alternative method of creating constants.
use Data::Dumper; use Readonly; use strict; Readonly my $REGEX => qr/^(\d{4})-(\d{2})-(\d{2})/; my $s = '2011-02-15'; my ($y, $m, $d) = ($s =~ $REGEX); print Data::Dumper->Dump([$y, $m, $d], [qw/y m d/]);