in reply to Re: Regexp and substitution question
in thread Regexp and substitution question
I also recommend getting into the habit of naming your captures; that way it's much clearer: "now does $capture[4] contain the right value, or was it $capture[3]?". If you do this:
you'll be much less likely to set someone's age to 180 and their weight to 40.my($name, $age, $weight) = ($line =~ /$pattern/);
|
|---|