Often you can just assign the results of the match. Make sure you are in list context if you have only one capture.
in reply to Re: Perl oddities
in thread Perl oddities
my ($this, $that, $some, $other) = /(this)(that).*(some)....(other)$/;
my ($cap) = /hello(there)/; # OK
my $cap = /hello(there)/; # BUG