Subject: | Hash key being assigned to $1 instead of $_ |
Diff attached.
Subject: | diff.txt |
248d247
< #$c is the config hash we're building:
250d248
<
255d252
< #If there are equal signs in @v...
257,258d253
<
< #...iterate through each array element in @v and set each element to $_ :
261,272c256,257
< #If the array element has an equal sign in it...
< if (/(.*)=(.*)/)
< {
< #Set the subkey and subvalue to $1 and $2 pattern matches:
< ($subkey, $subvalue) = ($1,$2);
< }
< #...otherwise, if the array element does not contain an equals sign:
< else
< {
< #Set the subkey to the array element ($_) and the subvalue to "1":
< $subkey = $_; $subvalue = 1;
< }
---
> if (/(.*)=(.*)/) { ($subkey, $subvalue) = ($1,$2); }
> else { $subkey = $1; $subvalue = 1; }