title: How can I check if all elements of an array are identical in Perl?
body: <p>I have an array <code>@test</code>. What's the best way to check if each element of the array is the same string?</p>
  
  <p>I know I can do it with a <code>foreach</code> loop but is there a better way to do this? I checked out the map function but I'm not sure if that's what I need.</p>