title: Is there the keyword 'with' in Perl?
body: <p>In this file</p>
  
  <p><a href="https://github.com/csirtgadgets/massive-octo-spice/blob/develop/src/lib/CIF/Observable/Binary.pm" rel="nofollow">https://github.com/csirtgadgets/massive-octo-spice/blob/develop/src/lib/CIF/Observable/Binary.pm</a>,</p>
  
  <p>I was confused by the statement </p>
  
  <p>with 'CIF::Observable';</p>
  
  <p>at line 9.Is there the keyword 'with' in Perl? How it works?</p>
  
  <pre><code>package CIF::Observable::Binary;
  
  use strict;
  use warnings;
  
  use Mouse;
  use Digest::SHA qw/sha256_hex/;
  
  with 'CIF::Observable';
  
  use constant DEFAULT_HASH_TYPE =&gt; 'sha256';
  
  has '+otype' =&gt; (
  default =&gt; 'binary',
  );  
  
  has 'hash' =&gt; (
  is      =&gt; 'ro',
  isa     =&gt; 'CIF::Type::Hash',
  default =&gt; sub { sha256_hex($_[0]-&gt;{'observable'}) },
  );  
  
  has 'htype' =&gt; (
  is      =&gt; 'ro',
  isa     =&gt; 'Str',
  default =&gt; DEFAULT_HASH_TYPE(),
  );  
  
  sub process {}
  sub understands {
  my $self = shift;
  my $args = shift;
  
  return unless($args-&gt;{'observable'});
  return unless($args-&gt;{'otype'});
  return unless($args-&gt;{'otype'} eq 'binary');
  return 1;
  } 
  __PACKAGE__-&gt;meta()-&gt;make_immutable();
  
  1;
  </code></pre>