in reply to Loading a Hash directly from a Regex
Additionally, the code of:
is dangerous, because when the match fails, you get the previous value of $1 and friends. Always do this in the conditional based on the match:/^(\d+)\W\d+\W\d+\W(\d+)\W\w+/; $CpmRC{$1}=$2;
if (/^(\d+)\W\d+\W\d+\W(\d+)\W\w+/) { $CpmRC{$1}=$2; }
-- Randal L. Schwartz, Perl hacker
|
|---|