in reply to Variable assignment confusion
Though unless you need it, I'd just change with the original value:$retid =~ /\A(\d{4})(_\d{3})?\z/ or die "Malformed ret. id\n"; my $new_retid = $1 . ( $2 ? $2 : '_001' );
Update: s/\Q\d{4}/(\\d{4})/ of course. Thanks catching this to Not_a_Number.$retid .= '_001' if not $2;
Makeshifts last the longest.
|
|---|