August 1999 Return to the Perl Hardware Store Slide #18

Reference Operations

        $x == $y

is true if and only if $x and $y refer to the same thing.

        sub index_of_object {
          my ($obj, @o_list) = @_;
          my $i;
          for ($i=0; $i < @o_list; $i++) {
            return $i if $o_list[$i] == $obj;
          }
          return;
        }
        sub obj_eq {
          my ($a, $b) = @_;
          return 1 if $a == $b;
          deep_compare($a, $b);
        }


Next Copyright © 1999 M-J. Dominus