Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
Re: Class::Struct problemby choroba (Cardinal) |
on Aug 28, 2022 at 19:31 UTC ( [id://11146478]=note: print w/replies, xml ) | Need Help?? |
You are populating the regex slot with a reference to an array. If you change the contents of the array and assign the reference to it to the second object's slot, the reference will stay the same. Either declare a new my array in the loop for each iteration, or use an anonymous array:
map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]
In Section
Seekers of Perl Wisdom
|
|