File tree Expand file tree Collapse file tree 2 files changed +3
-4
lines changed Expand file tree Collapse file tree 2 files changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -267,13 +267,12 @@ sub inContext { my $self = shift; $self->context(@_); $self }
267267
268268# ############################################################
269269
270- #
271270#
272271# The address of a Value object (actually ANY perl value).
273272# Use this to compare two objects to see of they are
274273# the same object (avoids automatic stringification).
275274#
276- sub address { oct ( sprintf ( " 0x %p " , shift ) ) }
275+ sub address { Scalar::Util::refaddr( shift ) }
277276
278277sub isBlessed { (Scalar::Util::blessed(shift ) // ' ' ) ne " " }
279278sub blessedClass { Scalar::Util::blessed(shift ) }
Original file line number Diff line number Diff line change @@ -200,12 +200,12 @@ sub Compare {
200200 $ans -> {ans_message } = $ans -> {error_message } = " " ;
201201 $ans -> {score } = 0;
202202
203- if (sprintf ( " %p " , $self ) ne sprintf ( " %p " , $ans -> {correct_value }) ) {
203+ if ($self -> address != $ans -> {correct_value }-> address ) {
204204 $ans -> {correct_ans } = $self -> string;
205205 $ans -> {correct_value } = $self ;
206206 $ans -> {correct_formula } = Value-> Package(" Formula" )-> new($self );
207207 }
208- if (sprintf ( " %p " , $other ) ne sprintf ( " %p " , $ans -> {student_value }) ) {
208+ if ($other -> address != $ans -> {student_value }-> address ) {
209209 $ans -> {student_ans } = $other -> string;
210210 $ans -> {student_value } = $other ;
211211 $ans -> {student_formula } = Value-> Package(" Formula" )-> new($other );
You can’t perform that action at this time.
0 commit comments