# Attribution - For Handles

- ## Two kinds of attributes: Handle Attributes and Method Attributes

- ## A DBI handle is a reference to a hash

- ## Handle Attributes can be read or set by accessing the hash via the reference

  $h->{AutoCommit} = 0;
  $autocomitting = $h->{AutoCommit};

- ## Some attributes are read-only

  $sth->{NUM_OF_FIELDS} = 42; # fatal error

- ## Using an unknown attribute triggers a warning

  $sth->{AutoCommat} = 42; # triggers a warning
  $autocomitting = $sth->{AutoCommat}; # triggers a warning
  - driver-private attributes (which have lowercase names) do not trigger a warning

Previous slide | Next slide | Back to first slide | View graphic version