title: How to pattern match on list vs single element
body: <p>I am trying to understand how can you pattern match in Erlang for single elements vs lists:</p>
  
  <pre><code>guarded(T) when T&gt;5 ; T&lt;3 -&gt; 3+T;
  guarded([X,Y]) when X&gt;3,Y&gt;3 -&gt;{X+1,Y+1};
  guarded([X,_|[T,_]]) when X rem 2==0, T rem 2 =/= 1-&gt; [T,X];
  guarded(_)-&gt;"something else".
  
  
  
  guarded([1,2,3]).  -&gt; goes into case 1 , how can i make sure it doesn't (and goes to last case)
  </code></pre>
  
  <blockquote>
    <p>** exception error: an error occurred when evaluating an arithmetic expression
         in function  main:guarded/1</p>
  </blockquote>
  
  <p>Where would i need to place the first case , when i want to pattern match on single elements.I mean i want to have a case that works for single elements and a wild-card-pattern too (last expression).</p>