princepawn has asked for the wisdom of the Perl Monks concerning the following question:

if ($eval =~ /^(p|BUG)?\d+(\D.*)$/) { warn $eval; warn "$1{bugfix_number}$2"; } else { die "$eval could not be regularized"; }
How do I actually get p or BUG to be bound to $1

Replies are listed 'Best First'.
Re: How can I get regexp alternation to bind $1
by no_slogan (Deacon) on Jul 25, 2001 at 01:14 UTC
    $1{bugfix_number} means fetch from the hash %1. Maybe you meant ${1}{bugfix_number}?